Skia
2D Graphics Library
sksg::Node Class Referenceabstract

Base class for all scene graph nodes. More...

#include <SkSGNode.h>

Inheritance diagram for sksg::Node:

Public Member Functions

const SkRectrevalidate (InvalidationController *, const SkMatrix &)
 
void invalidate (bool damage=true)
 
bool unique () const
 May return true if the caller is the only owner. More...
 
void ref () const
 Increment the reference count. More...
 
void unref () const
 Decrement the reference count. More...
 

Protected Types

enum  InvalTraits { kBubbleDamage_Trait = 1 << 0 , kOverrideDamage_Trait = 1 << 1 }
 

Protected Member Functions

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

Friends

class NodePriv
 
class RenderNode
 

Detailed Description

Base class for all scene graph nodes.

Handles ingress edge management for the DAG (i.e. node -> "parent" node mapping), and invalidation.

Note: egress edges are only implemented/supported in container subclasses (e.g. Group, Effect, Draw).

Member Enumeration Documentation

◆ InvalTraits

enum sksg::Node::InvalTraits
protected
Enumerator
kBubbleDamage_Trait 
kOverrideDamage_Trait 

Constructor & Destructor Documentation

◆ Node()

sksg::Node::Node ( uint32_t  invalTraits)
explicitprotected

◆ ~Node()

sksg::Node::~Node ( )
overrideprotected

Member Function Documentation

◆ bounds()

const SkRect& sksg::Node::bounds ( ) const
inlineprotected

◆ hasInval()

bool sksg::Node::hasInval ( ) const
inlineprotected

◆ invalidate()

void sksg::Node::invalidate ( bool  damage = true)

◆ observeInval()

void sksg::Node::observeInval ( const sk_sp< Node > &  )
protected

◆ onRevalidate()

◆ ref()

void SkRefCntBase::ref ( ) const
inlineinherited

Increment the reference count.

Must be balanced by a call to unref().

◆ revalidate()

const SkRect& sksg::Node::revalidate ( InvalidationController ,
const SkMatrix  
)

◆ unique()

bool SkRefCntBase::unique ( ) const
inlineinherited

May return true if the caller is the only owner.

Ensures that all previous owner's actions are complete.

◆ unobserveInval()

void sksg::Node::unobserveInval ( const sk_sp< Node > &  )
protected

◆ unref()

void SkRefCntBase::unref ( ) const
inlineinherited

Decrement the reference count.

If the reference count is 1 before the decrement, then delete the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.

Friends And Related Function Documentation

◆ NodePriv

friend class NodePriv
friend

◆ RenderNode

friend class RenderNode
friend

Member Data Documentation

◆ fInvalObserver

Node* sksg::Node::fInvalObserver

◆ fInvalObserverArray

std::vector<Node*>* sksg::Node::fInvalObserverArray

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