Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Static Public Member Functions | Protected Member Functions | List of all members
sksg::RRect Class Referencefinal

#include <SkSGRect.h>

Inheritance diagram for sksg::RRect:
sksg::GeometryNode sksg::Node SkRefCnt SkRefCntBase

Static Public Member Functions

static sk_sp< RRectMake ()
 
static sk_sp< RRectMake (const SkRRect &rr)
 

Protected Member Functions

void onClip (SkCanvas *, bool antiAlias) const override
 
void onDraw (SkCanvas *, const SkPaint &) const override
 
bool onContains (const SkPoint &) const override
 
SkRect onRevalidate (InvalidationController *, const SkMatrix &) override
 
SkPath onAsPath () const override
 
- Protected Member Functions inherited from sksg::GeometryNode
 GeometryNode ()
 
- Protected Member Functions inherited from sksg::Node
 Node (uint32_t invalTraits)
 
 ~Node () override
 
const SkRectbounds () const
 
bool hasInval () const
 
void observeInval (const sk_sp< Node > &)
 
void unobserveInval (const sk_sp< Node > &)
 

Additional Inherited Members

- Public Member Functions inherited from sksg::GeometryNode
void clip (SkCanvas *, bool antiAlias) const
 
void draw (SkCanvas *, const SkPaint &) const
 
bool contains (const SkPoint &) const
 
SkPath asPath () 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 Types inherited from sksg::Node
enum  InvalTraits { kBubbleDamage_Trait = 1 << 0 , kOverrideDamage_Trait = 1 << 1 }
 

Detailed Description

Concrete Geometry node, wrapping an SkRRect.

Definition at line 80 of file SkSGRect.h.

Member Function Documentation

◆ Make() [1/2]

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

Definition at line 82 of file SkSGRect.h.

82{ return sk_sp<RRect>(new RRect(SkRRect())); }

◆ Make() [2/2]

static sk_sp< RRect > sksg::RRect::Make ( const SkRRect rr)
inlinestatic

Definition at line 83 of file SkSGRect.h.

83{ return sk_sp<RRect>(new RRect(rr)); }

◆ onAsPath()

SkPath sksg::RRect::onAsPath ( ) const
overrideprotectedvirtual

Implements sksg::GeometryNode.

Definition at line 76 of file SkSGRect.cpp.

76 {
77 return SkPath::RRect(fRRect, this->getDirection(), this->getInitialPointIndex());
78}
static SkPath RRect(const SkRRect &, SkPathDirection dir=SkPathDirection::kCW)
Definition SkPath.cpp:3534

◆ onClip()

void sksg::RRect::onClip ( SkCanvas canvas,
bool  antiAlias 
) const
overrideprotectedvirtual

Implements sksg::GeometryNode.

Definition at line 46 of file SkSGRect.cpp.

46 {
47 canvas->clipRRect(fRRect, SkClipOp::kIntersect, antiAlias);
48}
void clipRRect(const SkRRect &rrect, SkClipOp op, bool doAntiAlias)

◆ onContains()

bool sksg::RRect::onContains ( const SkPoint p) const
overrideprotectedvirtual

Implements sksg::GeometryNode.

Definition at line 54 of file SkSGRect.cpp.

54 {
55 if (!fRRect.rect().contains(p.x(), p.y())) {
56 return false;
57 }
58
59 if (fRRect.isRect()) {
60 return true;
61 }
62
63 // TODO: no SkRRect::contains(x, y)
67 p.y() + SK_ScalarNearlyZero));
68}
#define SK_ScalarNearlyZero
Definition SkScalar.h:99
const SkRect & rect() const
Definition SkRRect.h:264
bool isRect() const
Definition SkRRect.h:84
bool contains(const SkRect &rect) const
Definition SkRRect.cpp:360
bool contains(SkScalar x, SkScalar y) const
Definition extension.cpp:19
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition SkRect.h:646

◆ onDraw()

void sksg::RRect::onDraw ( SkCanvas canvas,
const SkPaint paint 
) const
overrideprotectedvirtual

Implements sksg::GeometryNode.

Definition at line 50 of file SkSGRect.cpp.

50 {
51 canvas->drawRRect(fRRect, paint);
52}
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
const Paint & paint

◆ onRevalidate()

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

Implements sksg::Node.

Definition at line 70 of file SkSGRect.cpp.

70 {
71 SkASSERT(this->hasInval());
72
73 return fRRect.getBounds();
74}
#define SkASSERT(cond)
Definition SkAssert.h:116
const SkRect & getBounds() const
Definition SkRRect.h:279
bool hasInval() const
Definition SkSGNode.h:60

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