You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: disable-color-correct-rendering flag is not respected #34592
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
17.4.2
What operating system are you using?
macOS
Operating System Version
11.6.1
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Required: disable-color-correct-rendering is enabled and using wide gamut display
In the provided gist, there are 2 div elements on the page. The 1st div's red background should render with wide gamut colors i.e. it should correctly respect the disable-color-correct-rendering flag.
Actual Behavior
The 1st div's red background renders incorrectly in sRGB (i.e. it seems to disregard the disable-color-correct-rendering flag).
If only the 1st element is present, its red background does render correctly with wide gamut colors (i.e. it correctly respects the disable-color-correct-rendering flag). There seems to be some interaction between the 2 elements that causes the flag to switch from being respected to not being respected.
Chromium has switched to using its Skia renderer instead of the GL renderer sometime last year. To revert to the GL renderer, you can try adding the following code:
Thanks for the quick response. I'm not sure I fully understand what's happening in my example. In my gist, it looks like the disable-color-correct-rendering flag is working when there is only 1 div but not when there are 2. In the version of Electron I'm using, it sounds like both OpenGL and Skia are supported and maybe the OpenGL renderer has been patched to respect the flag but the Skia renderer has not. Is it possible that different renderers are being used e.g. with 1 div, it uses the OpenGL renderer, which respects the flag and renders correctly, but for 2 divs, it switches to Skia (if you know of reasons why that would happen, that would be very informative), which does not respect the flag and renders incorrectly?
Activity
samuelmaddock commentedon Jun 16, 2022
The disable_color_correct_rendering.patch—which is responsible for allowing this functionality—only applies to the OpenGL renderer used by Chromium. This renderer has been deprecated and was actually removed at the beginning of the month in Chromium upstream.
Chromium has switched to using its Skia renderer instead of the GL renderer sometime last year. To revert to the GL renderer, you can try adding the following code:
This should allow the patch to continue working, likely until the next few major versions of Electron.
cc @poiru This patch will likely need to be reworked onto the Skia renderer.
poiru commentedon Jun 16, 2022
Redirecting my cc to @Hans-Halverson
landersonfigma commentedon Jun 16, 2022
Thanks for the quick response. I'm not sure I fully understand what's happening in my example. In my gist, it looks like the disable-color-correct-rendering flag is working when there is only 1 div but not when there are 2. In the version of Electron I'm using, it sounds like both OpenGL and Skia are supported and maybe the OpenGL renderer has been patched to respect the flag but the Skia renderer has not. Is it possible that different renderers are being used e.g. with 1 div, it uses the OpenGL renderer, which respects the flag and renders correctly, but for 2 divs, it switches to Skia (if you know of reasons why that would happen, that would be very informative), which does not respect the flag and renders incorrectly?