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

OffscreenCanvas #161

Closed
fserb opened this issue Sep 28, 2022 · 4 comments
Closed

OffscreenCanvas #161

fserb opened this issue Sep 28, 2022 · 4 comments
Labels
accepted An accepted proposal focus-area-proposal Focus Area Proposal

Comments

@fserb
Copy link

fserb commented Sep 28, 2022

Description

OffscreenCanvas allows for a faster graphics API that is detached from the Document. It also enables out-of-main-thread graphics API on WebWorkers. The support should include 2D, WebGL, and WebGPU support, both on main thread and on workers.

Rationale

OffscreenCanvas on Workers has a pretty strong developer demand. We can see tutorials and demos all over the place. Developers recognize and identify the multiple use cases: out of main thread rendering, and faster DOM-independent operations. OffscreenCanvas is also widely used inside Google.

On WASM codebases, it’s a necessary API to support out-of-main-thread rendering, which is common in games (with the WebGL context).

For 2D context, the extra performance (a lot of operations are faster on OffscreenCanvas due to its independence from the Document and style) and the ability to step outside the main thread processing (which is often a contentious resource), makes it a widely used feature.

Firefox tracking bug: OffscreenCanvas, 2D.
WebKit tracking bug: OffscreenCanvas.

Specification

WHATWG relevant spec:
https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface

The spec needs some refreshment that we are ready to work on and would do it sooner, if this gets picked up by Interop: we need to clean up the old commit() spec that doesn’t exist anymore, and write a new rendering model for Workers.

Tests

Canvas2D: wpt/html/canvas/offscreen
WebGL: wpt/webgl
WebGPU: gpuweb/cts

The coverage for 2D is pretty broad, including WebWorker, transferred OffscreenCanvas, and main thread.
WebGL has a worker.js IDL test, but it seems to be missing on the repo.
WebGPU has only minor coverage on WPT. We would add at least some basic usage tests (not the full CTS).

@foolip foolip added the focus-area-proposal Focus Area Proposal label Sep 28, 2022
@benjamind
Copy link

We at Adobe are strongly in support of adding this!

OffscreenCanvas is an essential capability for highly performant apps that do any sort of rendering.

@gsnedders gsnedders added this to the Interop 2023 milestone Sep 29, 2022
@foolip foolip moved this to Proposed in Interop 2023 Oct 7, 2022
@foolip foolip removed this from the Interop 2023 milestone Oct 7, 2022
@foolip
Copy link
Member

foolip commented Nov 11, 2022

In the MDN short survey on APIs & JavaScript, "OffscreenCanvas" was selected by ~12% of survey takers, putting it in the bottom third of options. (There is some uncertainty as with any survey data.)

@jgraham
Copy link
Contributor

jgraham commented Nov 16, 2022

We think that this should exclude canvas filter tests, since that's just part of the normal canvas API that isn't directly related to offscreen canvas.

@foolip foolip added the accepted An accepted proposal label Feb 1, 2023
@foolip
Copy link
Member

foolip commented Feb 1, 2023

Thank you for proposing Offscreen Canvas for inclusion in Interop 2023.

We are pleased to let you know that this proposal was accepted as the Offscreen Canvas focus area. You can follow the progress of this Focus Area on the Interop 2023 dashboard.

For an overview of our process, see the proposal selection summary. Thank you 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
Labels
accepted An accepted proposal focus-area-proposal Focus Area Proposal
Projects
No open projects
Status: Proposed
Development

No branches or pull requests

5 participants