On Wed, 9 Nov 2022 18:30:26 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> tests/system/src/test/java/test/robot/javafx/scene/PixelBufferDrawTest.java >> line 189: >> >>> 187: >>> 188: private void compareColor(Color exp, Color act) { >>> 189: Assert.assertEquals(exp.getRed(), act.getRed(), 0.01); >> >> I am curious: what is the source of these differences? >> Is it color model (and could we explicitly set the CM?) >> Or is it differences in anti-aliasing or some such? > > It's a good question, but I note that any number of things can cause such > differences on some systems. As I mentioned in the bug report, most of our > robot-based tests use `0.07` as a tolerance value. The idea being that these > tests aren't trying to check whether the rendering is pixel perfect or that > the shaders, etc., produce an exact value. They are just checking whether the > pixel is red versus green versus orange, etc. I decided to do a bit more digging and I found out that those tests pass with original 0.005 tolerance if you plug in an external display and make it your main. In short: * Plugged in a 1080p display via HDMI port * Made the 1080p display the main display * To be sure tests will execute on it I mirrored 1080p display contents onto built-in Retina XDR display (I couldn't find an option to disable it). As a result, these tests started to pass again. Hard to say why exactly that happens, could be HiDPI-related, could be no HDR on my 1080p display, could be something else... Regardless, higher tolerance in these tests should still be okay as Kevin mentioned. ------------- PR: https://git.openjdk.org/jfx/pull/944