Skip to content

1681-engine / index / workerPainter

Function: workerPainter() ​

ts
function workerPainter<T>(options): Painter<T>;

Defined in: src/assets/workerPainter.ts:19

A Painter that paints in a worker. The worker answers each request with a PaintReply carrying the request's id, transferring the pixel buffer (postMessage(reply, { transfer: [reply.pixels] })) so nothing is copied back. A worker that cannot start or fails rejects everything under way and everything after: a prepainter then simply paints nothing ahead.

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
optionsWorkerPainterOptions<T>

Returns ​

Painter<T>

Released under the MIT License.