Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
sksg::Shader Class Referenceabstract

#include <SkSGRenderEffect.h>

Inheritance diagram for sksg::Shader:
sksg::Node SkRefCnt SkRefCntBase sksg::Gradient sksg::LinearGradient sksg::RadialGradient

Public Member Functions

 ~Shader () override
 
const sk_sp< SkShader > & getShader () 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
 

Protected Member Functions

 Shader ()
 
SkRect onRevalidate (InvalidationController *, const SkMatrix &) final
 
virtual sk_sp< SkShaderonRevalidateShader ()=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 base class.

Definition at line 39 of file SkSGRenderEffect.h.

Constructor & Destructor Documentation

◆ ~Shader()

sksg::Shader::~Shader ( )
overridedefault

◆ Shader()

sksg::Shader::Shader ( )
protected

Definition at line 86 of file SkSGRenderEffect.cpp.

86: INHERITED(kBubbleDamage_Trait) {}
@ kBubbleDamage_Trait
Definition: SkSGNode.h:46

Member Function Documentation

◆ getShader()

const sk_sp< SkShader > & sksg::Shader::getShader ( ) const
inline

Definition at line 43 of file SkSGRenderEffect.h.

43 {
44 SkASSERT(!this->hasInval());
45 return fShader;
46 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool hasInval() const
Definition: SkSGNode.h:60

◆ onRevalidate()

SkRect sksg::Shader::onRevalidate ( InvalidationController ,
const SkMatrix  
)
finalprotectedvirtual

Implements sksg::Node.

Definition at line 90 of file SkSGRenderEffect.cpp.

90 {
91 SkASSERT(this->hasInval());
92
93 fShader = this->onRevalidateShader();
94 return SkRect::MakeEmpty();
95}
virtual sk_sp< SkShader > onRevalidateShader()=0
static constexpr SkRect MakeEmpty()
Definition: SkRect.h:595

◆ onRevalidateShader()

virtual sk_sp< SkShader > sksg::Shader::onRevalidateShader ( )
protectedpure virtual

Implemented in sksg::Gradient.


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