Skia
2D Graphics Library
sksg::Group Class Reference

Concrete node, grouping together multiple descendants. More...

#include <SkSGGroup.h>

Inheritance diagram for sksg::Group:

Public Member Functions

void addChild (sk_sp< RenderNode >)
 
void removeChild (const sk_sp< RenderNode > &)
 
size_t size () const
 
bool empty () const
 
void clear ()
 
void render (SkCanvas *, const RenderContext *=nullptr) const
 
const RenderNodenodeAt (const SkPoint &point) const
 
bool isVisible () const
 
void setVisible (bool)
 
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...
 

Static Public Member Functions

static sk_sp< GroupMake ()
 
static sk_sp< GroupMake (std::vector< sk_sp< RenderNode >> children)
 

Protected Types

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

Protected Member Functions

 Group ()
 
 Group (std::vector< sk_sp< RenderNode >>)
 
 ~Group () override
 
void onRender (SkCanvas *, const RenderContext *) const override
 
const RenderNodeonNodeAt (const SkPoint &) const override
 
SkRect onRevalidate (InvalidationController *, const SkMatrix &) override
 
const SkRectbounds () const
 
bool hasInval () const
 
void observeInval (const sk_sp< Node > &)
 
void unobserveInval (const sk_sp< Node > &)
 

Detailed Description

Concrete node, grouping together multiple descendants.

Member Enumeration Documentation

◆ InvalTraits

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

Constructor & Destructor Documentation

◆ Group() [1/2]

sksg::Group::Group ( )
protected

◆ Group() [2/2]

sksg::Group::Group ( std::vector< sk_sp< RenderNode >>  )
explicitprotected

◆ ~Group()

sksg::Group::~Group ( )
overrideprotected

Member Function Documentation

◆ addChild()

void sksg::Group::addChild ( sk_sp< RenderNode )

◆ bounds()

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

◆ clear()

void sksg::Group::clear ( )

◆ empty()

bool sksg::Group::empty ( ) const
inline

◆ hasInval()

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

◆ invalidate()

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

◆ isVisible()

bool sksg::RenderNode::isVisible ( ) const
inherited

◆ Make() [1/2]

static sk_sp<Group> sksg::Group::Make ( )
inlinestatic

◆ Make() [2/2]

static sk_sp<Group> sksg::Group::Make ( std::vector< sk_sp< RenderNode >>  children)
inlinestatic

◆ nodeAt()

const RenderNode* sksg::RenderNode::nodeAt ( const SkPoint &  point) const
inherited

◆ observeInval()

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

◆ onNodeAt()

const RenderNode* sksg::Group::onNodeAt ( const SkPoint &  ) const
overrideprotectedvirtual

Implements sksg::RenderNode.

◆ onRender()

void sksg::Group::onRender ( SkCanvas ,
const RenderContext  
) const
overrideprotectedvirtual

Implements sksg::RenderNode.

◆ onRevalidate()

SkRect sksg::Group::onRevalidate ( InvalidationController ,
const SkMatrix  
)
overrideprotectedvirtual

Implements sksg::Node.

◆ ref()

void SkRefCntBase::ref ( ) const
inlineinherited

Increment the reference count.

Must be balanced by a call to unref().

◆ removeChild()

void sksg::Group::removeChild ( const sk_sp< RenderNode > &  )

◆ render()

void sksg::RenderNode::render ( SkCanvas ,
const RenderContext = nullptr 
) const
inherited

◆ revalidate()

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

◆ setVisible()

void sksg::RenderNode::setVisible ( bool  )
inherited

◆ size()

size_t sksg::Group::size ( ) const
inline

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

◆ 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.

Member Data Documentation

◆ fInvalObserver

Node* sksg::Node::fInvalObserver
inherited

◆ fInvalObserverArray

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

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