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

I'd like the spec to say a bit more about how "desynchronized" affects event handling, if at all. Presumably the page still has to run JS to handle pointer events and call canvas API; does that part follow the normal HTML event loop rules? If so, isn't canvas update rate still limited by how responsive the event loop is? #4865

Open
annevk opened this issue Aug 26, 2019 · 2 comments

Comments

@annevk
Copy link
Member

annevk commented Aug 26, 2019

I'd like the spec to say a bit more about how "desynchronized" affects event handling, if at all. Presumably the page still has to run JS to handle pointer events and call canvas API; does that part follow the normal HTML event loop rules? If so, isn't canvas update rate still limited by how responsive the event loop is?

Originally posted by @smfr in #4087 (comment)

@annevk
Copy link
Member Author

annevk commented Aug 26, 2019

cc @YellowDoge

@wffurr
Copy link

wffurr commented Aug 26, 2019

The "desynchronized" attribute does not affect event handling in any way. Mentions of "input processing" were removed from the spec after requests to do so: #4360 (comment)

In general, yes, the canvas update rate is still limited by the event loop. As long as there's no major blocking events happening in the event loop, there is still a substantial gain in elapsed wall time between a stylus touching the screen and the canvas changing color, due to bypassing the compositor and using direct scanout hardware to the display.

The desynchronized attribute can be combined with a number of other techniques to mitigate event loop blocking: pointerrawupdate, offscreen canvas, passive event listeners, sending input events to a worker, careful control of main thread JS, etc.

A desynchronized canvas is just one technique of many that can be used together to write a high performance drawing app or other "event-to-display" latency sensitive app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants