Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
SkCanvas::SaveLayerRec Struct Reference

#include <SkCanvas.h>

Public Member Functions

 SaveLayerRec ()
 
 SaveLayerRec (const SkRect *bounds, const SkPaint *paint, SaveLayerFlags saveLayerFlags=0)
 
 SaveLayerRec (const SkRect *bounds, const SkPaint *paint, const SkImageFilter *backdrop, SaveLayerFlags saveLayerFlags)
 
 SaveLayerRec (const SkRect *bounds, const SkPaint *paint, const SkImageFilter *backdrop, const SkColorSpace *colorSpace, SaveLayerFlags saveLayerFlags)
 

Public Attributes

const SkRectfBounds = nullptr
 
const SkPaintfPaint = nullptr
 
FilterSpan fFilters = {}
 
const SkImageFilterfBackdrop = nullptr
 
const SkColorSpacefColorSpace = nullptr
 
SaveLayerFlags fSaveLayerFlags = 0
 

Friends

class SkCanvas
 
class SkCanvasPriv
 

Detailed Description

SaveLayerRec contains the state used to create the layer.

Definition at line 684 of file SkCanvas.h.

Constructor & Destructor Documentation

◆ SaveLayerRec() [1/4]

SkCanvas::SaveLayerRec::SaveLayerRec ( )
inline

Sets fBounds, fPaint, and fBackdrop to nullptr. Clears fSaveLayerFlags.

Returns
empty SaveLayerRec

Definition at line 689 of file SkCanvas.h.

689{}

◆ SaveLayerRec() [2/4]

SkCanvas::SaveLayerRec::SaveLayerRec ( const SkRect bounds,
const SkPaint paint,
SaveLayerFlags  saveLayerFlags = 0 
)
inline

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

Parameters
boundslayer dimensions; may be nullptr
paintapplied to layer when overlaying prior layer; may be nullptr
saveLayerFlagsSaveLayerRec options to modify layer
Returns
SaveLayerRec with empty fBackdrop

Definition at line 698 of file SkCanvas.h.

699 : SaveLayerRec(bounds, paint, nullptr, nullptr, 1.f, saveLayerFlags, /*filters=*/{}) {}
const Paint & paint

◆ SaveLayerRec() [3/4]

SkCanvas::SaveLayerRec::SaveLayerRec ( const SkRect bounds,
const SkPaint paint,
const SkImageFilter backdrop,
SaveLayerFlags  saveLayerFlags 
)
inline

Sets fBounds, fPaint, fBackdrop, and fSaveLayerFlags.

Parameters
boundslayer dimensions; may be nullptr
paintapplied to layer when overlaying prior layer; may be nullptr
backdropIf 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.
saveLayerFlagsSaveLayerRec options to modify layer
Returns
SaveLayerRec fully specified

Definition at line 713 of file SkCanvas.h.

715 : SaveLayerRec(bounds, paint, backdrop, nullptr, 1.f, saveLayerFlags, /*filters=*/{}) {}

◆ SaveLayerRec() [4/4]

SkCanvas::SaveLayerRec::SaveLayerRec ( const SkRect bounds,
const SkPaint paint,
const SkImageFilter backdrop,
const SkColorSpace colorSpace,
SaveLayerFlags  saveLayerFlags 
)
inline

Sets fBounds, fColorSpace, and fSaveLayerFlags.

Parameters
boundslayer dimensions; may be nullptr
paintapplied to layer when overlaying prior layer; may be nullptr
backdropIf 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.
colorSpaceIf not null, when the layer is restored, a color space conversion will be applied from this color space to the parent's color space. The restore paint and backdrop filters will be applied in this color space. If null, the new layer will inherit the color space from its parent.
saveLayerFlagsSaveLayerRec options to modify layer
Returns
SaveLayerRec fully specified

Definition at line 735 of file SkCanvas.h.

737 : SaveLayerRec(bounds, paint, backdrop, colorSpace, 1.f, saveLayerFlags, /*filters=*/{}) {}

Friends And Related Symbol Documentation

◆ SkCanvas

friend class SkCanvas
friend

Definition at line 766 of file SkCanvas.h.

◆ SkCanvasPriv

friend class SkCanvasPriv
friend

Definition at line 767 of file SkCanvas.h.

Member Data Documentation

◆ fBackdrop

const SkImageFilter* SkCanvas::SaveLayerRec::fBackdrop = nullptr

If not null, this triggers the same initialization behavior as setting kInitWithPrevious_SaveLayerFlag 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).

Definition at line 753 of file SkCanvas.h.

◆ fBounds

const SkRect* SkCanvas::SaveLayerRec::fBounds = nullptr

hints at layer size limit

Definition at line 740 of file SkCanvas.h.

◆ fColorSpace

const SkColorSpace* SkCanvas::SaveLayerRec::fColorSpace = nullptr

If not null, this triggers a color space conversion when the layer is restored. It will be as if the layer's contents are drawn in this color space. Filters from fBackdrop and fPaint will be applied in this color space.

Definition at line 760 of file SkCanvas.h.

◆ fFilters

FilterSpan SkCanvas::SaveLayerRec::fFilters = {}

Definition at line 745 of file SkCanvas.h.

745{};

◆ fPaint

const SkPaint* SkCanvas::SaveLayerRec::fPaint = nullptr

modifies overlay

Definition at line 743 of file SkCanvas.h.

◆ fSaveLayerFlags

SaveLayerFlags SkCanvas::SaveLayerRec::fSaveLayerFlags = 0

preserves LCD text, creates with prior layer contents

Definition at line 763 of file SkCanvas.h.


The documentation for this struct was generated from the following file: