Skip to content

Add P3 in WebGL Canvas tests to Color Spaces and Functions focus area #168

Closed

Description

@astearns

Description

The Color Spaces and Functions focus area was great in 2022 for improving interop around wide color gamuts. But one path for better support was missed, because there are no WPT tests for WebGL Canvas color spaces. Apparently there are some tests for this in the Khronos WebGL conformance tests.

So I propose to enhance the Color Spaces and Functions focus area for 2023 with some Khronos WebGL tests, if we can figure out a way to pull or generate test results from them.

Rationale

Wide color gamut support in WebGL Canvas is necessary for performant color management in apps like Photoshop on the web. We currently work around the lack by creating multiple Canvases which gets very memory-intensive.

Specification

https://registry.khronos.org/webgl/specs/latest/1.0/#DOM-WebGLRenderingContext-drawingBufferColorSpace

Tests

@ccameron-chromium likely has a good idea of what is covered there (and what tests could be added).

Activity

  1. added this to the milestone on Sep 30, 2022
  2. foolip commented on Oct 3, 2022

    @foolip
    Member

    Are there tests for 2D canvas using new CSS color already?

  3. ccameron-chromium commented on Oct 3, 2022

    @ccameron-chromium

    There are many WPT tests for display P3 2D canvas (from a few different contributors).

    There are WebGL conformance tests in Khronos for display P3 WebGL canvas. They test importing content of various types and color spaces into WebGL (exhaustively testing all of the cropping, flipping, etc, flags).

    If we want to complement the WebGL conformance testing, then we probably want to focus on exporting. This includes toBlob and toDataURL functions (as is done by the existing 2d.color.space.p3.toBlob.p3.canvas.html and 2d.color.space.p3.toDataURL.p3.canvas.html), as well as drawing into a 2D canvas (directly and via ImageBitmap).

    If we want to somewhat-replicate some of the WebGL conformance testing, then we'd probably want to replicate the various combinations in wpt/html/canvas/element/manual/wide-gamut-canvas, replacing the 2D drawImage with the WebGL texImage2D.

    Finally, if we want to completely replicate WebGL conformance testing, we can add the exhaustive cross-products (but that's probably a bit much).

  4. moved this to Proposed in Interop 2023on Oct 7, 2022
  5. removed this from the milestone on Oct 7, 2022
  6. gsnedders commented on Oct 16, 2022

    @gsnedders
    Member

    There are WebGL conformance tests in Khronos for display P3 WebGL canvas.

    These are https://github.com/KhronosGroup/WebGL, specifically those with unpackColorSpace, right?

    Running these tests at https://registry.khronos.org/webgl/sdk/tests/webgl-conformance-tests.html has almost everything within those tests passing, or is that outdated?

  7. gsnedders commented on Nov 10, 2022

    @gsnedders
    Member

    If we migrated some tests into WPT to test this, would we have any infrastructure problems with running these? (e.g., browsers being run in setups that only allows WebGL to operate against sRGB?)

  8. jgraham commented on Nov 15, 2022

    @jgraham
    Contributor

    I also don't know the answer to that, and it makes me nervous about accepting this, independent of the technical merits of the proposal. In general I think we should aim to already know we can run the tests for a proposal before making a decision on it.

  9. ccameron-chromium commented on Nov 15, 2022

    @ccameron-chromium

    e.g., browsers being run in setups that only allows WebGL to operate against sRGB?

    It is always required to be able to create a P3 canvas. Even if there exist no >sRGB monitors attached to the system, the canvas must still be create-able, because it can be exported (e.g, to an image or a video stream, or to another canvas).

  10. nairnandu commented on Feb 1, 2023

    @nairnandu
    Contributor

    Thank you for proposing WebGL Canvas tests for inclusion in Interop 2023.

    We wanted to let you know that this proposal was not selected to be part of Interop this year. We had many strong proposals, and could not accept them all. As discussed in the issue comments, the proposal depended on porting tests from the Khronos WebGL testsuite into web-platform-tests. That work seems out of scope for the Interop effort, and making a one-off port risks creating confusion. However this should not be taken as a comment on the technology as a whole, and a future proposal would be welcome if we can find a general solution to running WebGL tests in web-platform-tests.

    For an overview of our process, see the proposal selection summary. Thank you again for contributing to Interop 2023!

    Posted on behalf of the Interop team.

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

    focus-area-proposal

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions