meo-skia-canvas
    Preparing search index...

    Interface CanvasState

    The graphics-state stack, and resetting it.

    interface CanvasState {
        isContextLost(): boolean;
        reset(): void;
        restore(): void;
        save(): void;
        saveLayer(
            alpha?: number,
            bounds?: [number, number, number, number] | null,
            backdrop?: ImageFilter | null,
        ): void;
    }

    Hierarchy (View Summary)

    Index
    • Always false.

      Context loss is a GPU-compositor event -- a browser reclaiming the backing store of a backgrounded tab -- and there is no compositor here. A canvas either has its surface or its construction failed.

      MDN Reference

      Returns boolean

    • Push an isolated compositing layer (CanvasKit saveLayer). Draws until the matching restore() accumulate into the layer, which is then composited onto the canvas at alpha (default 1) with the current globalCompositeOperation. bounds is an optional [x, y, w, h] that clips the layer -- Skia describes it as a sizing hint for the offscreen, but nothing outside it is drawn. backdrop applies an ImageFilter to the content behind the layer (blur-behind / frosted glass). Not part of the HTML Canvas standard.

      🧪 Not in the HTML Canvas standard.

      Parameters

      • Optionalalpha: number
      • Optionalbounds: [number, number, number, number] | null
      • Optionalbackdrop: ImageFilter | null

      Returns void