Skia
2D Graphics Library
SkCanvas::SaveLayerRec Struct Reference

SaveLayerRec contains the state used to create the layer. More...

#include <SkCanvas.h>

Public Member Functions

 SaveLayerRec ()
 Sets fBounds, fPaint, and fBackdrop to nullptr. More...
 
 SaveLayerRec (const SkRect *bounds, const SkPaint *paint, SaveLayerFlags saveLayerFlags=0)
 Sets fBounds, fPaint, and fSaveLayerFlags; sets fBackdrop to nullptr. More...
 
 SaveLayerRec (const SkRect *bounds, const SkPaint *paint, const SkImageFilter *backdrop, SaveLayerFlags saveLayerFlags)
 Sets fBounds, fPaint, fBackdrop, and fSaveLayerFlags. More...
 

Public Attributes

const SkRectfBounds = nullptr
 hints at layer size limit More...
 
const SkPaintfPaint = nullptr
 modifies overlay More...
 
const SkImageFilterfBackdrop = 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. More...
 
SaveLayerFlags fSaveLayerFlags = 0
 preserves LCD text, creates with prior layer contents More...
 

Friends

class SkCanvas
 
class SkCanvasPriv
 

Detailed Description

SaveLayerRec contains the state used to create the layer.

Constructor & Destructor Documentation

◆ SaveLayerRec() [1/3]

SkCanvas::SaveLayerRec::SaveLayerRec ( )
inline

Sets fBounds, fPaint, and fBackdrop to nullptr.

Clears fSaveLayerFlags.

Returns
empty SaveLayerRec

◆ SaveLayerRec() [2/3]

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

◆ SaveLayerRec() [3/3]

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

Friends And Related Function Documentation

◆ SkCanvas

friend class SkCanvas
friend

◆ SkCanvasPriv

friend class SkCanvasPriv
friend

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).

◆ fBounds

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

hints at layer size limit

◆ fPaint

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

modifies overlay

◆ fSaveLayerFlags

SaveLayerFlags SkCanvas::SaveLayerRec::fSaveLayerFlags = 0

preserves LCD text, creates with prior layer contents


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