JDK-8255679 : RegionBackgroundImageUITest.unalignedImage_Cover fails because of wrong color
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-10-30
  • Updated: 2024-03-15
  • Resolved: 2024-03-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx23 b09Fixed
Related Reports
Relates :  
Relates :  
Description
RegionBackgroundImageUITest.unalignedImage_Cover fails only on Mac with following error.
----------
test.robot.javafx.scene.layout.RegionBackgroundImageUITest > unalignedImage_Cover FAILED
    java.lang.AssertionError: expected:rgba(0,255,0,255) but was:rgba(0,201,54,255) at position x=134, y=134
        at test.robot.javafx.scene.layout.RegionUITestBase.assertColorEquals(RegionUITestBase.java:114)
        at test.robot.javafx.scene.layout.RegionBackgroundImageUITest.checkNonRepeating(RegionBackgroundImageUITest.java:1026)
        at test.robot.javafx.scene.layout.RegionBackgroundImageUITest.unalignedImage_Cover(RegionBackgroundImageUITest.java:677)
----------

Test failed even before JDK-8088739 was fixed.
Comments
Changeset: c196454e Author: Jayathirth D V <jdv@openjdk.org> Committer: Ajit Ghaisas <aghaisas@openjdk.org> Date: 2024-03-14 12:25:41 +0000 URL: https://git.openjdk.org/jfx/commit/c196454e76dec1cbcd028e12d99f052981a63a4e
14-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1400 Date: 2024-03-13 08:56:13 +0000
13-03-2024

I took screencapture and compared between different platforms about how we are drawing with different background size like cover, contain and other positions. I ran this test in both macOS and Windows under same external monitor with uiScale = 1 and resolution 1920 * 1080. It fails in both the platforms with same exception and is not specific to macOS : RegionBackgroundImageUITest > unalignedImage_Cover FAILED java.lang.AssertionError: expected:rgba(0,255,0,255) but was:rgba(0,181,74,255) at position x=134, y=134 at test.robot.javafx.scene.layout.RegionUITestBase.assertColorEquals(RegionUITestBase.java:114) at test.robot.javafx.scene.layout.RegionBackgroundImageUITest.checkNonRepeating(RegionBackgroundImageUITest.java:1066) at test.robot.javafx.scene.layout.RegionBackgroundImageUITest.unalignedImage_Cover(RegionBackgroundImageUITest.java:716) This test needs specific condition of scaling and resolution under which it starts failing. Root cause of this test failure is it assumes that red,green & blue bands in the test image are of equal size and picks color based on that assumption. If we take 20 * 20 aligned image, each scanline is 3 red pixels -> 3 green pixels -> 8 blue pixels -> 3 green pixels -> 3 red pixels. So the blue pixels actually acquire more space in a scanline. Even in y direction pattern is same. If we 48 * 48 unaligned image, each scanline is 7 red pixels -> 8 green pixels -> 19 blue pixels -> 7 green pixels -> 7 red pixels. So the blue pixels actually acquire more space in a scanline. Even in y direction pattern is same. So when this 48 * 48 image is scaled to 336 * 336 in case of unalignedImage_Cover, we are calculating picking point for green color in such a way that it is hitting border of green and blue bands and test is failing. Only in this specific scenario we are scaling by large amount and the inappropriate color picking logic is failing. We need to update this color picking logic based on how much space each color is taking up in a scanline.
13-03-2024

I still see this failure if i force it to run on mac : RegionBackgroundImageUITest > unalignedImage_Cover FAILED java.lang.AssertionError: expected:rgba(0,255,0,255) but was:rgba(0,201,54,255) at position x=134, y=134 at test.robot.javafx.scene.layout.RegionUITestBase.assertColorEquals(RegionUITestBase.java:114) at test.robot.javafx.scene.layout.RegionBackgroundImageUITest.checkNonRepeating(RegionBackgroundImageUITest.java:1066) at test.robot.javafx.scene.layout.RegionBackgroundImageUITest.unalignedImage_Cover(RegionBackgroundImageUITest.java:716)
12-03-2024