Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag AWT windows as sRGB surfaces #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rsauciuc
Copy link

@rsauciuc rsauciuc commented May 7, 2022

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

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: 208508346
Change-Id: Ie4c8dd2e41ba4f92db0c59e94825512ea93c6553
@avu
Copy link
Collaborator

avu commented May 19, 2022

@rsauciuc did you suggest this change to OpenJDK ? I wonder why such a simple fix has not been integrated in the main line.

@romainguy
Copy link

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 :/

@rock3r
Copy link

rock3r commented May 25, 2022

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

@avu
Copy link
Collaborator

avu commented May 31, 2022

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.

@avu
Copy link
Collaborator

avu commented May 31, 2022

I've filed JBR-4530 to implement this feature within JBR-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants