Skip to content

Commit

Permalink
8255724: [XRender] the BlitRotateClippedArea test fails on Linux in t…
Browse files Browse the repository at this point in the history
…he XR pipeline

Backport-of: dcd6e0da245338de68d9dede451e233f4bfaa934
  • Loading branch information
GoeLin committed Jul 25, 2022
1 parent 20a5c40 commit 8b9f01d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Expand Up @@ -216,7 +216,6 @@ java/awt/image/DrawImage/IncorrectClipXorModeSW2Surface.java 8196025 windows-all
java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java 8196025 windows-all
java/awt/image/DrawImage/IncorrectSourceOffset.java 8196086 windows-all
java/awt/image/DrawImage/IncorrectUnmanagedImageRotatedClip.java 8196087 windows-all
java/awt/image/DrawImage/BlitRotateClippedArea.java 8255724 linux-all
java/awt/image/MultiResolutionImage/MultiResolutionDrawImageWithTransformTest.java 8198390 generic-all
java/awt/image/multiresolution/MultiresolutionIconTest.java 8169187 macosx-all
java/awt/print/Headless/HeadlessPrinterJob.java 8196088 windows-all
Expand Down
17 changes: 11 additions & 6 deletions test/jdk/java/awt/image/DrawImage/BlitRotateClippedArea.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -36,7 +36,7 @@

/**
* @test
* @bug 8255722
* @bug 8255722 8255724
* @key headful
*/
public class BlitRotateClippedArea {
Expand Down Expand Up @@ -103,10 +103,15 @@ private static void validate(BufferedImage gold, BufferedImage img)
throws IOException {
for (int x = 0; x < gold.getWidth(); ++x) {
for (int y = 0; y < gold.getHeight(); ++y) {
if (gold.getRGB(x, y) != img.getRGB(x, y)) {
ImageIO.write(gold, "png", new File("gold.png"));
ImageIO.write(img, "png", new File("snapshot.png"));
throw new RuntimeException("Test failed.");
Color goldColor = new Color(gold.getRGB(x, y));
Color actualColor = new Color(img.getRGB(x, y));
if ((Math.abs(goldColor.getRed() - actualColor.getRed()) > 1) ||
(Math.abs(goldColor.getGreen() - actualColor.getGreen()) > 1) ||
(Math.abs(goldColor.getBlue() - actualColor.getBlue()) > 1)) {
ImageIO.write(gold, "png", new File("gold.png"));
ImageIO.write(img, "png", new File("snapshot.png"));
throw new RuntimeException("Test failed for pixel :"
+ x + "/" + y);
}
}
}
Expand Down

1 comment on commit 8b9f01d

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.