RFR: 8325445: [macOS] Colors are not displayed in sRGB color space [v3]

Andy Goryachev angorya at openjdk.org
Thu Aug 1 18:18:38 UTC 2024


On Tue, 30 Jul 2024 23:31:38 GMT, Martin Fox <mfox at openjdk.org> wrote:

>> tests/system/src/test/java/test/robot/javafx/scene/SRGBTest.java line 52:
>> 
>>> 50: 
>>> 51: import org.junit.Test;
>>> 52: import static org.junit.Assume.assumeTrue;
>> 
>> should we use junit5 for the new tests?
>
> This test is based on the VisualTestBase test harness class which is written using junit4. I use that test harness since it contains waitFirstFrame and waitNextFrame as well as existing utility routines for reporting on color mismatches.

you are right, please disregard.

>> tests/system/src/test/java/test/robot/javafx/scene/SRGBTest.java line 68:
>> 
>>> 66:     // The component tolerance allows one bit of rounding when writing a color
>>> 67:     // out and another bit when reading it back in.
>>> 68:     static final double COMPONENT_TOLERANCE = 2.0 / 255.0;
>> 
>> suggestion: 2.0001 / 255.0 to account for floating point errors
>
> I'm not sure this test needs to be that precise. And I'm fine with the threshold falling below 2.0/255.0 since it should be as small as possible (I even experimented briefly with lower numbers). I haven't run into an issue on the three platforms I've run this test on.

Then the comment might not be technically correct, because it is possible to have "two bit difference" in the integer color values, yet fail due to small error intrinsic in floating point operations.

Example:

a=253 b=251 delta=0.007843137254902044 tol=0.00784313725490196

delta=0.007843137254902044
  tol=0.00784313725490196  (2.0 / 255.0)

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1473#discussion_r1700570982
PR Review Comment: https://git.openjdk.org/jfx/pull/1473#discussion_r1700598001


More information about the openjfx-dev mailing list