Contact emails
Spec
https://html.spec.whatwg.org/#the-offscreencanvas-interface
https://github.com/whatwg/html/pull/3677
https://github.com/whatwg/html/pull/3708
https://github.com/w3ctag/design-reviews/issues/141
https://github.com/w3ctag/design-reviews/issues/288
Summary
This would launch OffscreenCanvas and requestAnimationFrame on DedicatedWorkers.
OffscreenCanvas allows developers to use canvas APIs to render to screen or to textures from window or workers. It does so with a slightly less overhead.
requestAnimationFrame on workers allow developers to have a vsync and rendering bound event on workers.
Link to “Intent to Implement” blink-dev discussion
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
Debuggability
There may be issues regarding the rendering specific part of DevTools (FPS meter, for example). But apart from that, no extra attention needed.
Risks
Edge: No signal.
Firefox: Developed under a flag. Latest changes LGTMed.
Safari: No signal.
The final spec details are still to be submitted, but have been LGTMed and issues brought up on W3C Tag were all addressed.
Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.
Yes. https://wpt.fyi/results/offscreen-canvas
Entry on the feature dashboard
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADp2-T8HPDAN7PM7q6w5pc8SFoWJ4szzMdw3R7T%2B%2BBt0Ad_ihQ%40mail.gmail.com.
Ergonomics
OffscreenCanvas is used together with Canvas and other graphics-related APIs (texImage2D on WebGL, for example). There's a minimal increase in complexity that comes from that.
OffscreenCanvas also has a .commit() function that only executes on workers and is a synchronous function. The commit() function is made to be used by busy-loop type of applications, and was added to support new WebAssembly use cases.
On the Worker.requestAnimationFrame side, it does add a new complexity for DedicatedWorkers. That added complexity comes from the fact that now Worker may have a logical connection to the display/Window they were created in. This is not exposed directly to developers in any way.
Activation
OffscreenCanvas itself is simple to use. Polyfill-wise, it's almost a drop in replacement for Canvas. That said, it does come with some extra functions that allow people to, for example, use it on Workers. Developers will need to learn about that.
It could benefit a lot from more external documentation and outreach, not so much of libraries.
We already have custom modification to support, for example, Three.js on Workers.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADp2-T_vrkkji-9NzHybZ0HbmpKosZr%2BJ10E2DNNPXexxLEONA%40mail.gmail.com.
Ahn, I can clarify that. :)I don't think such a move would be made more complex by this. Workers are still independent from main-frame rendering. I really meant a "logical connection". :) What we do now is, at Worker creation time, we pass some info to the worker that it then uses to communicate with the GPU process directly. There's no extra coupling of any sort with the main thread. Does that clarify it?
We do have issues on their trackers for implementation that have been ack'ed and assigned. I didn't know that qualified as "public signal".On Web Developers feedback, sorry for not adding those:There's been some feedback from people experimenting with it on beta: https://twitter.com/ebidel/status/975788240463585281?lang=enrelated reddit thread: https://www.reddit.com/r/javascript/comments/85reh7/excited_that_offscreencanvas_is_finally_happening/Microsoft/TypeScript folks are also on it: https://twitter.com/drosenwasser/status/1008941418608381952
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADp2-T_vrkkji-9NzHybZ0HbmpKosZr%2BJ10E2DNNPXexxLEONA%40mail.gmail.com.
Those are valid points. The current spec states that only DedicatedWorkers that come (directly or indirectly) from a scope with a Window have valid requestAnimationFrame. If there's no associated Window down the line, then we won't provide requestAnimationFrame (for now, we are throwing an exception, until there's some IDL mechanism to describe this).
Thanks!Ben
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2B1UsbR3cdndP389NQA%3D%2B7PP%3DJEd2LrhLmfRWdQdwCTyuriAxw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEga%2BV%2BaGQyoVr9K%3DR5p06_t3-7NapVxaOGHB1NHD13%2BSQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw8OP2bK1923%2BCrRN26tL2QfvJaZTVJkxw%3DYvTu_A-XTpw%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADp2-T8HPDAN7PM7q6w5pc8SFoWJ4szzMdw3R7T%2B%2BBt0Ad_ihQ%40mail.gmail.com.
--/* Opera Software, Linköping, Sweden: CEST (UTC+2) */
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADp2-T_vrkkji-9NzHybZ0HbmpKosZr%2BJ10E2DNNPXexxLEONA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADp2-T8HPDAN7PM7q6w5pc8SFoWJ4szzMdw3R7T%2B%2BBt0Ad_ihQ%40mail.gmail.com.
--/* Opera Software, Linköping, Sweden: CEST (UTC+2) */
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/fbcd9636-df4b-45eb-8132-7d9f7baea70d%40chromium.org.
While non-standard by now, the file system API has a synchronous variant that can (only) be used by workers, I believe it behaves the same way (blocking until it returns).Also, any other tight loop would do that same, right? I am not sure this is a new concept...
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABc02_%2BrAgiHXnmvyOFYJu0r%2B6fU_h_XXyxKjMjNAD5SZnNfzQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BOSsVaxROTaSuM5HTQukHquArZ0WM-3pG-iyPfJvv%3Dqcyp3bw%40mail.gmail.com.
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/fbcd9636-df4b-45eb-8132-7d9f7baea70d%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABc02_%2BrAgiHXnmvyOFYJu0r%2B6fU_h_XXyxKjMjNAD5SZnNfzQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
☆PhistucK
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/fbcd9636-df4b-45eb-8132-7d9f7baea70d%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABc02_%2BrAgiHXnmvyOFYJu0r%2B6fU_h_XXyxKjMjNAD5SZnNfzQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/fbcd9636-df4b-45eb-8132-7d9f7baea70d%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABc02_%2BrAgiHXnmvyOFYJu0r%2B6fU_h_XXyxKjMjNAD5SZnNfzQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
Not sure yet. Maybe fserb@ will have an opinion, but let's get it working for basic uses first.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOct_BFL2%3DxtbZe9dTjnE9K8qcc26ehdxPQe7G1nyp4LFLJjCg%40mail.gmail.com.
Just to clarify, we are still missing one spec change, Since there was no IDL change, and we only had to clean up some language around commit() being mandatory, we were waiting for the other changes to land before sending this one. The spec that matches it is:I'm still not sure what you mean by commit making SharedArrayBuffers/Atomics more complicated. The browser may throttle anything at any time. Any implementation will have to deal with this even without commit().
In order for WebAssembly threads to use the OpenGL ES API to render via WebGL, it's necessary to have a way to present frames on demand, and to throttle the application if it's swamping the graphics processor. That's why OffscreenCanvas.commit() is required, and why it has to be able to block execution until it completes.It's understood that WebAssembly's thread execution model – which is C's threading model, where the main loop of the thread never exits – is incongruous with web workers' event-driven model. APIs using promises don't work well, and since the main loop never exits, messages posted to the wasm thread will never be received. This area will require more work. APIs WebAssembly threads are finally on the verge of shipping, so let's get them turned on and start figuring out whether more primitives are needed, for example manually running a single posted message or event.-Ken
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/fbcd9636-df4b-45eb-8132-7d9f7baea70d%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABc02_%2BrAgiHXnmvyOFYJu0r%2B6fU_h_XXyxKjMjNAD5SZnNfzQ%40mail.gmail.com.
☆PhistucK
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/fbcd9636-df4b-45eb-8132-7d9f7baea70d%40chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABc02_%2BrAgiHXnmvyOFYJu0r%2B6fU_h_XXyxKjMjNAD5SZnNfzQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BOSsVaxROTaSuM5HTQukHquArZ0WM-3pG-iyPfJvv%3Dqcyp3bw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/8948de37-7fc4-4df5-b340-804feff9f8c8%40chromium.org.
Since this seems to be a point of confusion, we've decided to put commit() back under a flag until other APIs catch up to it.The rest of OffscreenCanvas and RAF are still shipping as before.