Skip to content

[Bug]: disable-color-correct-rendering flag is not respected #34592

Closed

Description

@landersonfigma

Preflight Checklist

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.

Testcase Gist URL

https://gist.github.com/landersonfigma/10b141139cd97271ac7c1dfb3cd60e44

Additional Information

No response

Activity

  1. samuelmaddock commented on Jun 16, 2022

    @samuelmaddock
    Member

    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:

    app.commandLine.appendSwitch('disable-features', 'UseSkiaRenderer');

    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.

  2. poiru commented on Jun 16, 2022

    @poiru
    Contributor

    Redirecting my cc to @Hans-Halverson

  3. landersonfigma commented on Jun 16, 2022

    @landersonfigma
    Author

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions