Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Protected Member Functions | List of all members
sksg::CustomRenderNode Class Reference

#include <SkSGRenderNode.h>

Inheritance diagram for sksg::CustomRenderNode:
sksg::RenderNode sksg::Node SkRefCnt SkRefCntBase skottie::internal::MotionBlurEffect

Protected Member Functions

 CustomRenderNode (std::vector< sk_sp< RenderNode > > &&children)
 
 ~CustomRenderNode () override
 
const std::vector< sk_sp< RenderNode > > & children () const
 
bool hasChildrenInval () 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

Clients outside SkSG looking to implement custom render nodes, should derive from this class instead of RenderNode. It handles various book-keeping, and provides a controlled extension point.

Definition at line 140 of file SkSGRenderNode.h.

Constructor & Destructor Documentation

◆ CustomRenderNode()

sksg::CustomRenderNode::CustomRenderNode ( std::vector< sk_sp< RenderNode > > &&  children)
explicitprotected

Definition at line 231 of file SkSGRenderNode.cpp.

232 : INHERITED(kOverrideDamage_Trait) // We cannot make any assumptions - override conservatively.
233 , fChildren(std::move(children)) {
234 for (const auto& child : fChildren) {
235 this->observeInval(child);
236 }
237}
const std::vector< sk_sp< RenderNode > > & children() const
void observeInval(const sk_sp< Node > &)
Definition SkSGNode.cpp:61
@ kOverrideDamage_Trait
Definition SkSGNode.h:49

◆ ~CustomRenderNode()

sksg::CustomRenderNode::~CustomRenderNode ( )
overrideprotected

Definition at line 239 of file SkSGRenderNode.cpp.

239 {
240 for (const auto& child : fChildren) {
241 this->unobserveInval(child);
242 }
243}
void unobserveInval(const sk_sp< Node > &)
Definition SkSGNode.cpp:84

Member Function Documentation

◆ children()

const std::vector< sk_sp< RenderNode > > & sksg::CustomRenderNode::children ( ) const
inlineprotected

Definition at line 145 of file SkSGRenderNode.h.

145{ return fChildren; }

◆ hasChildrenInval()

bool sksg::CustomRenderNode::hasChildrenInval ( ) const
protected

Definition at line 245 of file SkSGRenderNode.cpp.

245 {
246 for (const auto& child : fChildren) {
247 if (NodePriv::HasInval(child)) {
248 return true;
249 }
250 }
251
252 return false;
253}
static bool HasInval(const sk_sp< Node > &node)

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