Flutter Engine
The Flutter Engine
Static Public Member Functions | Protected Member Functions | List of all members
SkSVGRect Class Referencefinal

#include <SkSVGRect.h>

Inheritance diagram for SkSVGRect:
SkSVGShape SkSVGTransformableNode SkSVGNode SkRefCnt SkRefCntBase

Static Public Member Functions

static sk_sp< SkSVGRectMake ()
 

Protected Member Functions

bool parseAndSetAttribute (const char *, const char *) override
 
void onDraw (SkCanvas *, const SkSVGLengthContext &, const SkPaint &, SkPathFillType) const override
 
SkPath onAsPath (const SkSVGRenderContext &) const override
 
SkRect onObjectBoundingBox (const SkSVGRenderContext &) const override
 
- Protected Member Functions inherited from SkSVGShape
 SkSVGShape (SkSVGTag)
 
void onRender (const SkSVGRenderContext &) const final
 
virtual void onDraw (SkCanvas *, const SkSVGLengthContext &, const SkPaint &, SkPathFillType) const =0
 
- Protected Member Functions inherited from SkSVGTransformableNode
 SkSVGTransformableNode (SkSVGTag)
 
bool onPrepareToRender (SkSVGRenderContext *) const override
 
void onSetAttribute (SkSVGAttribute, const SkSVGValue &) override
 
void mapToParent (SkPath *) const
 
void mapToParent (SkRect *) const
 
- Protected Member Functions inherited from SkSVGNode
 SkSVGNode (SkSVGTag)
 
virtual bool onPrepareToRender (SkSVGRenderContext *) const
 
virtual void onRender (const SkSVGRenderContext &) const =0
 
virtual bool onAsPaint (const SkSVGRenderContext &, SkPaint *) const
 
virtual SkPath onAsPath (const SkSVGRenderContext &) const =0
 
virtual void onSetAttribute (SkSVGAttribute, const SkSVGValue &)
 
virtual bool hasChildren () const
 
virtual SkRect onObjectBoundingBox (const SkSVGRenderContext &) const
 

Additional Inherited Members

- Public Member Functions inherited from SkSVGShape
void appendChild (sk_sp< SkSVGNode >) override
 
- Public Member Functions inherited from SkSVGTransformableNode
void setTransform (const SkSVGTransformType &t)
 
- Public Member Functions inherited from SkSVGNode
 ~SkSVGNode () override
 
SkSVGTag tag () const
 
virtual void appendChild (sk_sp< SkSVGNode >)=0
 
void render (const SkSVGRenderContext &) const
 
bool asPaint (const SkSVGRenderContext &, SkPaint *) const
 
SkPath asPath (const SkSVGRenderContext &) const
 
SkRect objectBoundingBox (const SkSVGRenderContext &) const
 
void setAttribute (SkSVGAttribute, const SkSVGValue &)
 
bool setAttribute (const char *attributeName, const char *attributeValue)
 
virtual bool parseAndSetAttribute (const char *name, const char *value)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 
- Static Protected Member Functions inherited from SkSVGNode
static SkMatrix ComputeViewboxMatrix (const SkRect &, const SkRect &, SkSVGPreserveAspectRatio)
 

Detailed Description

Definition at line 16 of file SkSVGRect.h.

Member Function Documentation

◆ Make()

static sk_sp< SkSVGRect > SkSVGRect::Make ( )
inlinestatic

Definition at line 18 of file SkSVGRect.h.

18{ return sk_sp<SkSVGRect>(new SkSVGRect()); }

◆ onAsPath()

SkPath SkSVGRect::onAsPath ( const SkSVGRenderContext ctx) const
overrideprotectedvirtual

Implements SkSVGNode.

Definition at line 85 of file SkSVGRect.cpp.

85 {
86 SkPath path = SkPath::RRect(this->resolve(ctx.lengthContext()));
87
88 this->mapToParent(&path);
89
90 return path;
91}
Definition: SkPath.h:59
static SkPath RRect(const SkRRect &, SkPathDirection dir=SkPathDirection::kCW)
Definition: SkPath.cpp:3602
const SkSVGLengthContext & lengthContext() const
void mapToParent(SkPath *) const
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

◆ onDraw()

void SkSVGRect::onDraw ( SkCanvas canvas,
const SkSVGLengthContext lctx,
const SkPaint paint,
SkPathFillType   
) const
overrideprotectedvirtual

Implements SkSVGShape.

Definition at line 80 of file SkSVGRect.cpp.

81 {
82 canvas->drawRRect(this->resolve(lctx), paint);
83}
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
Definition: SkCanvas.cpp:1705
const Paint & paint
Definition: color_source.cc:38

◆ onObjectBoundingBox()

SkRect SkSVGRect::onObjectBoundingBox ( const SkSVGRenderContext ctx) const
overrideprotectedvirtual

Reimplemented from SkSVGNode.

Definition at line 93 of file SkSVGRect.cpp.

93 {
94 return ctx.lengthContext().resolveRect(fX, fY, fWidth, fHeight);
95}
SkRect resolveRect(const SkSVGLength &x, const SkSVGLength &y, const SkSVGLength &w, const SkSVGLength &h) const

◆ parseAndSetAttribute()

bool SkSVGRect::parseAndSetAttribute ( const char *  n,
const char *  v 
)
overrideprotectedvirtual

Reimplemented from SkSVGNode.

Definition at line 52 of file SkSVGRect.cpp.

52 {
54 this->setX(SkSVGAttributeParser::parse<SkSVGLength>("x", n, v)) ||
55 this->setY(SkSVGAttributeParser::parse<SkSVGLength>("y", n, v)) ||
56 this->setWidth(SkSVGAttributeParser::parse<SkSVGLength>("width", n, v)) ||
57 this->setHeight(SkSVGAttributeParser::parse<SkSVGLength>("height", n, v)) ||
58 this->setRx(SkSVGAttributeParser::parse<SkSVGLength>("rx", n, v)) ||
59 this->setRy(SkSVGAttributeParser::parse<SkSVGLength>("ry", n, v));
60}
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition: SkSVGNode.cpp:90

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