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

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

Closed
astearns opened this issue Sep 30, 2022 · 7 comments
Closed
Labels
focus-area-proposal Focus Area Proposal

Comments

@astearns
Copy link

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).

@astearns astearns added the focus-area-proposal Focus Area Proposal label Sep 30, 2022
@gsnedders gsnedders added this to the Interop 2023 milestone Sep 30, 2022
@foolip
Copy link
Member

foolip commented Oct 3, 2022

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

@ccameron-chromium
Copy link

ccameron-chromium commented Oct 3, 2022

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).

@foolip foolip moved this to Proposed in Interop 2023 Oct 7, 2022
@foolip foolip removed this from the Interop 2023 milestone Oct 7, 2022
@gsnedders
Copy link
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?

@gsnedders
Copy link
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?)

@jgraham
Copy link
Contributor

jgraham commented Nov 15, 2022

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.

@ccameron-chromium
Copy link

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).

@nairnandu
Copy link
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.

@jensimmons jensimmons mentioned this issue Oct 6, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
No open projects
Status: Proposed
Development

No branches or pull requests

6 participants