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

#include <SkSGPaint.h>

Inheritance diagram for sksg::ShaderPaint:
sksg::PaintNode sksg::Node SkRefCnt SkRefCntBase

Public Member Functions

 ~ShaderPaint () override
 
- Public Member Functions inherited from sksg::PaintNode
SkPaint makePaint () const
 
- 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
 

Static Public Member Functions

static sk_sp< ShaderPaintMake (sk_sp< Shader >)
 

Protected Member Functions

SkRect onRevalidate (InvalidationController *, const SkMatrix &) override
 
void onApplyToPaint (SkPaint *) const override
 
- Protected Member Functions inherited from sksg::PaintNode
 PaintNode ()
 
virtual void onApplyToPaint (SkPaint *) 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

- Protected Types inherited from sksg::Node
enum  InvalTraits { kBubbleDamage_Trait = 1 << 0 , kOverrideDamage_Trait = 1 << 1 }
 

Detailed Description

Shader-based paint.

Definition at line 91 of file SkSGPaint.h.

Constructor & Destructor Documentation

◆ ~ShaderPaint()

sksg::ShaderPaint::~ShaderPaint ( )
override

Definition at line 70 of file SkSGPaint.cpp.

70 {
71 this->unobserveInval(fShader);
72}
void unobserveInval(const sk_sp< Node > &)
Definition: SkSGNode.cpp:84

Member Function Documentation

◆ Make()

sk_sp< ShaderPaint > sksg::ShaderPaint::Make ( sk_sp< Shader sh)
static

Definition at line 60 of file SkSGPaint.cpp.

60 {
61 return sh ? sk_sp<ShaderPaint>(new ShaderPaint(std::move(sh)))
62 : nullptr;
63}
sh
Definition: run_sh.py:10

◆ onApplyToPaint()

void sksg::ShaderPaint::onApplyToPaint ( SkPaint paint) const
overrideprotectedvirtual

Implements sksg::PaintNode.

Definition at line 80 of file SkSGPaint.cpp.

80 {
81 paint->setShader(fShader->getShader());
82}
const Paint & paint
Definition: color_source.cc:38

◆ onRevalidate()

SkRect sksg::ShaderPaint::onRevalidate ( InvalidationController ic,
const SkMatrix ctm 
)
overrideprotectedvirtual

Implements sksg::Node.

Definition at line 74 of file SkSGPaint.cpp.

74 {
75 SkASSERT(this->hasInval());
76
77 return fShader->revalidate(ic, ctm);
78}
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool hasInval() const
Definition: SkSGNode.h:60

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