Offscreen Canvas (original) (raw)
Your browser does not support OffscreenCanvas.
If an app has long running rendering tasks (e.g. ray tracing in WebGL), running those tasks in a worker allows the web app’s UI to remain responsive while the rendering task runs continuously in the background.
The animation below is running a heavy task while changing the color theme. If you click on the button at such moment, the interaction is blocked for a short while causing bad user experience.
Runs on main thread
Canvas on main thread
Interaction is blocked when a theme is loading
Canvas on worker thread
Interaction works even if a theme is loading