Skip to content

Move getContext call to InternalRenderTask #20016

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryzokuken
Copy link
Collaborator

@ryzokuken ryzokuken commented Jun 17, 2025

Move the getContext call out of _createContext and into InternalRenderTask#initializeGraphics and adapt tests accordingly.

This is a precursor to moving the call into a worker thread to let us use OffscreenCanvas. The current position wouldn't work since we make transformations to the canvas object after the getContext call, which isn't allowed for OffscreenCanvas. Also it isn't allowed to clone or transferControlToOffscreen the canvas after the getContext call.

@ryzokuken ryzokuken self-assigned this Jun 17, 2025
@ryzokuken ryzokuken force-pushed the move-getcontext branch 3 times, most recently from 2027870 to f89b738 Compare June 17, 2025 13:14
This is a precursor to moving the call into a
worker thread to let us use `OffscreenCanvas`. The
current position wouldn't work since we make
transformations to the canvas object after the
getContext call, which isn't allowed for
OffscreenCanvas. Also it isn't allowed to clone or
`transferControlToOffscreen` the canvas after the
`getContext` call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants