Ir al contenido

LayerCache

Defined in: render/LayerCache.ts:19

Caches layer rendering to offscreen canvases so static content does not need to be redrawn every frame. Only dirty layers are redrawn.

new LayerCache(scale?): LayerCache

Defined in: render/LayerCache.ts:23

number = 1

LayerCache

get size(): number

Defined in: render/LayerCache.ts:56

Get the number of cached layers.

number

clear(): void

Defined in: render/LayerCache.ts:222

Clear the cache.

void


getLayer(layer): CachedLayer | null

Defined in: render/LayerCache.ts:65

Get a cached rendering for a layer. If the layer is dirty or not cached, it is re-rendered. Returns null if the layer has no visible parts.

Layer

CachedLayer | null


getScale(): number

Defined in: render/LayerCache.ts:34

Get the current scale.

number


isDirty(layerName): boolean

Defined in: render/LayerCache.ts:51

Check if a layer is dirty.

string

boolean


markAllDirty(): void

Defined in: render/LayerCache.ts:44

Mark all layers as dirty.

void


markDirty(layerName): void

Defined in: render/LayerCache.ts:39

Mark a layer as dirty (needs redraw).

string

void


removeLayer(name): void

Defined in: render/LayerCache.ts:228

Remove a specific layer from the cache.

string

void


setScale(scale): void

Defined in: render/LayerCache.ts:26

Set the device scale for cached rendering.

number

void