- Creates the
OffscreenCanvasinstance from a given
- Passes the
OffscreenCanvasand other values from the main thread to a
- Allows you to write your
Workercode in the main thread as a function.
- Falls back to running in the main thread if
OffscreenCanvasis not supported.
Here's a short example of how it is used:
Requiring OffscreenCanvas in a Web Worker
If you only want the render function to run if
OffscreenCanvas is available and can run in a Web Worker, then pass an options hash with
workerOnly set to
true as the fourth argument to the