Canvas.SaveLayerRec

class SaveLayerRec

SaveLayerRec contains the state used to create the layer.

Methods

__init__

Overloaded function.

Attributes

fBackdrop

If not null, this triggers the same initialization behavior as setting Canvas.SaveLayerFlags.kInitWithPrevious on fSaveLayerFlags: the current layer is copied into the new layer, rather than initializing the new layer with transparent-black.

fBounds

hints at layer size limit

fPaint

modifies overlay

fSaveLayerFlags

preserves LCD text, creates with prior layer contents

Methods

SaveLayerRec.__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: skia.Canvas.SaveLayerRec) -> None

    Sets fBounds, fPaint, and fBackdrop to nullptr.

    Clears fSaveLayerFlags.

  2. __init__(self: skia.Canvas.SaveLayerRec, bounds: skia.Rect, paint: skia.Paint, saveLayerFlags: int = 0) -> None

    Sets fBounds, fPaint, and fSaveLayerFlags; sets fBackdrop to nullptr.

    bounds:

    layer dimensions; may be nullptr

    paint:

    applied to layer when overlaying prior layer; may be nullptr

    saveLayerFlags:

    SaveLayerRec options to modify layer

  3. __init__(self: skia.Canvas.SaveLayerRec, bounds: skia.Rect, paint: skia.Paint, backdrop: skia.ImageFilter, saveLayerFlags: int) -> None

    Sets fBounds, fPaint, fBackdrop, and fSaveLayerFlags.

    bounds:

    layer dimensions; may be nullptr

    paint:

    applied to layer when overlaying prior layer; may be nullptr

    backdrop:

    If not null, this causes the current layer to be filtered by backdrop, and then drawn into the new layer (respecting the current clip). If null, the new layer is initialized with transparent-black.

    saveLayerFlags:

    SaveLayerRec options to modify layer

Attributes

SaveLayerRec.fBackdrop

If not null, this triggers the same initialization behavior as setting Canvas.SaveLayerFlags.kInitWithPrevious on fSaveLayerFlags: the current layer is copied into the new layer, rather than initializing the new layer with transparent-black.

This is then filtered by fBackdrop (respecting the current clip).

SaveLayerRec.fBounds

hints at layer size limit

SaveLayerRec.fPaint

modifies overlay

SaveLayerRec.fSaveLayerFlags

preserves LCD text, creates with prior layer contents