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

#include <SkSGRenderNode.h>

Inheritance diagram for sksg::RenderNode:
sksg::Node SkRefCnt SkRefCntBase sksg::CustomRenderNode sksg::Draw sksg::EffectNode sksg::Group sksg::Image skottie::internal::MotionBlurEffect sksg::BlenderEffect sksg::ClipEffect sksg::ColorFilter sksg::ExternalColorFilter sksg::ImageFilterEffect sksg::LayerEffect sksg::MaskEffect sksg::MaskShaderEffect sksg::OpacityEffect sksg::ShaderEffect sksg::TransformEffect skottie::internal::TextAdapter::GlyphDecoratorNode

Classes

struct  RenderContext
 
class  ScopedRenderContext
 

Public Member Functions

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 Member Functions

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

Friends

class ImageFilterEffect
 

Additional Inherited Members

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

Detailed Description

Base class for nodes which can render to a canvas.

Definition at line 34 of file SkSGRenderNode.h.

Constructor & Destructor Documentation

◆ RenderNode()

sksg::RenderNode::RenderNode ( uint32_t  inval_traits = 0)
explicitprotected

Definition at line 33 of file SkSGRenderNode.cpp.

33: INHERITED(inval_traits) {}

Member Function Documentation

◆ isVisible()

bool sksg::RenderNode::isVisible ( ) const

Definition at line 35 of file SkSGRenderNode.cpp.

35 {
36 return !(fNodeFlags & kInvisible_Flag);
37}

◆ nodeAt()

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

Definition at line 57 of file SkSGRenderNode.cpp.

57 {
58 return this->bounds().contains(p.x(), p.y()) ? this->onNodeAt(p) : nullptr;
59}
const SkRect & bounds() const
Definition: SkSGNode.h:55
virtual const RenderNode * onNodeAt(const SkPoint &p) const =0
bool contains(SkScalar x, SkScalar y) const
Definition: extension.cpp:19

◆ onNodeAt()

virtual const RenderNode * sksg::RenderNode::onNodeAt ( const SkPoint p) const
protectedpure virtual

◆ onRender()

virtual void sksg::RenderNode::onRender ( SkCanvas ,
const RenderContext  
) const
protectedpure virtual

◆ render()

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

Definition at line 49 of file SkSGRenderNode.cpp.

49 {
50 SkASSERT(!this->hasInval());
51 if (this->isVisible() && !this->bounds().isEmpty()) {
52 this->onRender(canvas, ctx);
53 }
54 SkASSERT(!this->hasInval());
55}
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool hasInval() const
Definition: SkSGNode.h:60
bool isVisible() const
virtual void onRender(SkCanvas *, const RenderContext *) const =0

◆ setVisible()

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

Definition at line 39 of file SkSGRenderNode.cpp.

39 {
40 if (v == this->isVisible()) {
41 return;
42 }
43
44 this->invalidate();
45 fNodeFlags = v ? (fNodeFlags & ~kInvisible_Flag)
46 : (fNodeFlags | kInvisible_Flag);
47}
void invalidate(bool damage=true)
Definition: SkSGNode.cpp:113

Friends And Related Function Documentation

◆ ImageFilterEffect

friend class ImageFilterEffect
friend

Definition at line 130 of file SkSGRenderNode.h.


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