Constructs a new canvas worker instance.
Note that many properties are only initialized after the host sent an initialization message.
Our global worker scope.
The rendering kernel class to construct.
The canvas element we're presenting to.
The ID of the worker.
The offscreen canvas we're rendering to.
Our rendering context to draw to.
The rendering kernel, which produces frames, and renders them to our offscreen canvas.
Manages frame rendering timing.
Readonly
selfThe global scope of the worker.
The addEventListener()
method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optional
options: boolean | AddEventListenerOptionsThe dispatchEvent()
method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
Posts a message to the host.
The message to post.
Reconfigure the worker.
New ID for this worker.
New canvas to render to.
New application options.
The removeEventListener()
method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
Optional
options: boolean | EventListenerOptionsRender a frame.
How many milliseconds have passed since the last invocation?
The canvas worker instance handles a web worker instance in worker instance itself, and handles a feedback channel to the host application.
It provides a thin abstraction over the web worker IPC messaging.