Flutter Engine
The Flutter Engine
Static Public Member Functions | Protected Member Functions | List of all members
sksg::MaskShaderEffect Class Referencefinal

#include <SkSGRenderEffect.h>

Inheritance diagram for sksg::MaskShaderEffect:
sksg::EffectNode sksg::RenderNode sksg::Node SkRefCnt SkRefCntBase

Static Public Member Functions

static sk_sp< MaskShaderEffectMake (sk_sp< RenderNode >, sk_sp< SkShader >=nullptr)
 

Protected Member Functions

void onRender (SkCanvas *, const RenderContext *) const override
 
- Protected Member Functions inherited from sksg::EffectNode
 EffectNode (sk_sp< RenderNode >, uint32_t inval_traits=0)
 
 ~EffectNode () override
 
void onRender (SkCanvas *, const RenderContext *) const override
 
const RenderNodeonNodeAt (const SkPoint &) const override
 
SkRect onRevalidate (InvalidationController *, const SkMatrix &) override
 
const sk_sp< RenderNode > & getChild () const
 
- Protected Member Functions inherited from sksg::RenderNode
 RenderNode (uint32_t inval_traits=0)
 
virtual void onRender (SkCanvas *, const RenderContext *) const =0
 
virtual const RenderNodeonNodeAt (const SkPoint &p) const =0
 
- Protected Member Functions inherited from sksg::Node
 Node (uint32_t invalTraits)
 
 ~Node () override
 
const SkRectbounds () const
 
bool hasInval () const
 
virtual SkRect onRevalidate (InvalidationController *, const SkMatrix &ctm)=0
 
void observeInval (const sk_sp< Node > &)
 
void unobserveInval (const sk_sp< Node > &)
 

Additional Inherited Members

- Public Member Functions inherited from sksg::RenderNode
void render (SkCanvas *, const RenderContext *=nullptr) const
 
const RenderNodenodeAt (const SkPoint &point) const
 
bool isVisible () const
 
void setVisible (bool)
 
- Public Member Functions inherited from sksg::Node
const SkRectrevalidate (InvalidationController *, const SkMatrix &)
 
void invalidate (bool damage=true)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
- Protected Types inherited from sksg::Node
enum  InvalTraits { kBubbleDamage_Trait = 1 << 0 , kOverrideDamage_Trait = 1 << 1 }
 

Detailed Description

Attaches a mask shader to the render DAG.

Definition at line 88 of file SkSGRenderEffect.h.

Member Function Documentation

◆ Make()

sk_sp< MaskShaderEffect > sksg::MaskShaderEffect::Make ( sk_sp< RenderNode child,
sk_sp< SkShader sh = nullptr 
)
static

Definition at line 24 of file SkSGRenderEffect.cpp.

24 {
25 return child ? sk_sp<MaskShaderEffect>(new MaskShaderEffect(std::move(child), std::move(sh)))
26 : nullptr;
27}
sh
Definition: run_sh.py:10

◆ onRender()

void sksg::MaskShaderEffect::onRender ( SkCanvas canvas,
const RenderContext ctx 
) const
overrideprotectedvirtual

Reimplemented from sksg::EffectNode.

Definition at line 34 of file SkSGRenderEffect.cpp.

34 {
35 const auto local_ctx = ScopedRenderContext(canvas, ctx)
36 .modulateMaskShader(fShader, canvas->getTotalMatrix());
37
38 this->INHERITED::onRender(canvas, local_ctx);
39}
SkMatrix getTotalMatrix() const
Definition: SkCanvas.cpp:1629
void onRender(SkCanvas *, const RenderContext *) const override

The documentation for this class was generated from the following files: