<AWT Dev> [13] Review Request: 8215105 java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java: Wrong Pixel Color

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Thu Mar 7 23:07:54 UTC 2019

Hi, Shura.
On 07/03/2019 14:28, Alexandre (Shura) Iline wrote:
> Bug description says:
> "The test java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java fails on MacOSX, Windows. This failure was also observed on Kubuntu (KDE) “

The bug contains "how to reproduce" information only for macOS (where it is fixed in the current webrev).
I cannot reproduce it on Windows/Linux(on Gnome, since KDE is unsupported)

> Should there be sub-bugs created for Mac OS and also other platforms?
> Shura
>> On Mar 6, 2019, at 10:08 PM, Sergey Bylokhov <Sergey.Bylokhov at oracle.com> wrote:
>> Hello.
>> Please review the fix for JDK 13.
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8215105
>> Fix: http://cr.openjdk.java.net/~serb/8215105/webrev.00
>> Notes about the current implementation.
>> 1. The native system reads the pixels using the current "Display Profile".
>> 2. The robot API saves pixels into BufferedImage, which uses the sRGB color profile.
>> 3. To convert pixels from native representation to sRGB we used "kCGColorSpaceGenericRGB" mode.
>> Note that during conversion we may lost a color precision, this is why we always configured our test systems to use "Generic RGB Profiles"
>> But the logic above does not work on macOS 10.13.6.
>> I have tested macOS 10.12/13/14 and the only constant which works on all systems is a kCGColorSpaceSRGB + Display Profile "sRGB IEC 61966-2.1".
>> So we can:
>> - Change nothing and skip "support" of 10.13.6 where "kCGColorSpaceGenericRGB" + "Generic RGB Profiles" does not work.
>> - Apply the current fix, but then we need to change the requirement to the test systems(macos 10.12->10.14) to use "sRGB IEC 61966-2.1"
>> But since "kCGColorSpaceGenericRGB is available only for legacy reasons." it make sense to use kCGColorSpaceSRGB anyway.
>> https://developer.apple.com/documentation/coregraphics/kcgcolorspacegenericrgb
>> -- 
>> Best regards, Sergey.

Best regards, Sergey.

More information about the awt-dev mailing list