Re: [css-houdini-drafts] [css-typed-om] use-case: data/audio visualization (#872)

> On second thought, this is a little about being able to draw on a canvas from a worker thread _directly_, the outcome is very similar.

What you're probably looking for is [OffscreenCanvas](https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface), this is basically a canvas that can be posted to a worker. Unfortunately the support for it is poor (only Chrome).

If you can generate visualizations pixel-by-pixel rgb data then [ImageData](https://html.spec.whatwg.org/multipage/canvas.html#imagedata) is probably what you want as it can be efficiently post-messaged from the worker. It's what I use due to the lack of support for `OffscreenCanvas` and have generally found it's performance fine.

-- 
GitHub Notification of comment by Jamesernator
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/872#issuecomment-735490653 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 30 November 2020 01:00:13 UTC