Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
sksg::PaintNode Class Referenceabstract

#include <SkSGPaint.h>

Inheritance diagram for sksg::PaintNode:
sksg::Node SkRefCnt SkRefCntBase sksg::Color sksg::ShaderPaint

Public Member Functions

SkPaint makePaint () 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

 PaintNode ()
 
virtual void onApplyToPaint (SkPaint *) 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

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

Detailed Description

Base class for nodes which provide a 'paint' (as opposed to geometry) for drawing (e.g. colors, gradients, patterns).

Roughly equivalent to Skia's SkPaint.

Definition at line 35 of file SkSGPaint.h.

Constructor & Destructor Documentation

◆ PaintNode()

sksg::PaintNode::PaintNode ( )
protected

Definition at line 21 of file SkSGPaint.cpp.

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

Member Function Documentation

◆ makePaint()

SkPaint sksg::PaintNode::makePaint ( ) const

Definition at line 23 of file SkSGPaint.cpp.

23 {
24 SkASSERT(!this->hasInval());
25
27
28 paint.setAntiAlias(fAntiAlias);
29 paint.setBlendMode(fBlendMode);
30 paint.setStyle(fStyle);
31 paint.setStrokeWidth(fStrokeWidth);
32 paint.setStrokeMiter(fStrokeMiter);
33 paint.setStrokeJoin(fStrokeJoin);
34 paint.setStrokeCap(fStrokeCap);
35
36 this->onApplyToPaint(&paint);
37
38 // Compose opacity on top of the subclass value.
39 paint.setAlpha(SkScalarRoundToInt(paint.getAlpha() * SkTPin<SkScalar>(fOpacity, 0, 1)));
40
41 return paint;
42}
#define SkASSERT(cond)
Definition SkAssert.h:116
#define SkScalarRoundToInt(x)
Definition SkScalar.h:37
bool hasInval() const
Definition SkSGNode.h:60
virtual void onApplyToPaint(SkPaint *) const =0
const Paint & paint

◆ onApplyToPaint()

virtual void sksg::PaintNode::onApplyToPaint ( SkPaint ) const
protectedpure virtual

Implemented in sksg::Color, and sksg::ShaderPaint.


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