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

Implement AnimationFrameProvider for DedicatedWorkerGlobalScope #24277

Open
gterzian opened this issue Sep 24, 2019 · 1 comment
Open

Implement AnimationFrameProvider for DedicatedWorkerGlobalScope #24277

gterzian opened this issue Sep 24, 2019 · 1 comment

Comments

@gterzian
Copy link
Member

@gterzian gterzian commented Sep 24, 2019

Spec: https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animationframeprovider

See the Window webidl for an example:

unsigned long requestAnimationFrame(FrameRequestCallback callback);

Relevant once we have #24276

@gterzian
Copy link
Member Author

@gterzian gterzian commented Sep 24, 2019

The interesting question is how to communicate between the compositor and a dedicated worker to trigger the animation callbacks.

Currently the constellation is not aware of such workers, which are "hidden" behind an EventLoop. So the constellation can only send messages to a ScriptThread, via the EventLoop interface.

We could have the script-thread forward the messages to the worker, and that might defeat the purpose of having the worker operate on an offscreen canvas independently from the "potentially janky JS main-thread"(effectively the script-thread), so we might want to add some plumbing so the worker can receive messages from the constellation/compositor directly and the rendering workflow is isolated from the script-thread.

I guess that might also mean having a direct sender from the worker to the relevant layout thread to trigger reflows? Or is that not relevant if the worker is only manipulating an OffscreenCanvas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.