Tag AWT windows as sRGB surfaces
OSX assumes windows are in the display's color space by default. Java2D assumes its output in sRGB, which means the sRGB colors are interpreted by the OS as being in the display's color space. This means that unless the display is set to use the sRGB color space, the final result on screen will look incorrect.
Issue: http://issuetracker.google.com/208508346 Change-Id: Ie4c8dd2e41ba4f92db0c59e94825512ea93c6553
@rsauciuc did you suggest this change to OpenJDK ? I wonder why such a simple fix has not been integrated in the main line.
The "problem" with this change in OpenJDK is that it could potentially impact existing apps. macOS windows are by default in the display color space and apps must manually tag them to be sRGB or properly convert colors. While this fix is safe in Android Studio/IntelliJ (since those apps assume sRGB colors), it might not be for all JVM apps (even though it would be for most if not almost all…). Ideally OpenJDK would have an AWT API to set the color space on the window itself :/
Just FYI, I am seeing similar colour space problems under Windows (tested with AS Electric Eel canary 2 and IJ 222 EAP).
Also, this PR should fix issues such as https://youtrack.jetbrains.com/issue/IDEA-264808/Colours-Scheme-colours-are-displayed-wrong-different
The "problem" with this change in OpenJDK is that it could potentially impact existing apps. macOS windows are by default in the display color space and apps must manually tag them to be sRGB or properly convert colors. While this fix is safe in Android Studio/IntelliJ (since those apps assume sRGB colors), it might not be for all JVM apps (even though it would be for most if not almost all…). Ideally OpenJDK would have an AWT API to set the color space on the window itself :/
I see. Recently we've introduced so-called JBR api to provide our IDEs with such additional features and in the same time keep our fork compliant with JCK. I think it would be better to provide this functionality via JBR api.
I've filed JBR-4530 to implement this feature within JBR-api