Variable: createMemoryCanvas
constcreateMemoryCanvas:CanvasFactory
Defined in: src/lib/classes/Layer/index.ts:47
Create an OffscreenCanvas whose pixels are kept in regular memory rather than on the GPU (its 2D context is made
with willReadFrequently). Reading its pixels, encoding it and copying it are then plain memory copies, which on
phones avoids long stalls waiting for the GPU (up to 15 seconds were seen on an iPhone), at the cost of drawing on
the CPU. PaintCanvas makes its canvases this way by default.
Example
const canvas = createMemoryCanvas(2000, 2000);