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

#include <SkSVGPath.h>

Inheritance diagram for SkSVGPath:
SkSVGShape SkSVGTransformableNode SkSVGNode SkRefCnt SkRefCntBase

Static Public Member Functions

static sk_sp< SkSVGPathMake ()
 

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 14 of file SkSVGPath.h.

Member Function Documentation

◆ Make()

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

Definition at line 16 of file SkSVGPath.h.

16{ return sk_sp<SkSVGPath>(new SkSVGPath()); }

◆ onAsPath()

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

Implements SkSVGNode.

Definition at line 35 of file SkSVGPath.cpp.

35 {
37 // clip-rule can be inherited and needs to be applied at clip time.
39 this->mapToParent(&path);
40 return path;
41}
SkPath fPath
Definition: SkPath.h:59
SkPathFillType asFillType() const
Definition: SkSVGTypes.h:361
const SkSVGPresentationContext & presentationContext() 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
SkSVGProperty< SkSVGFillRule, true > fClipRule
SkSVGPresentationAttributes fInherited

◆ onDraw()

void SkSVGPath::onDraw ( SkCanvas canvas,
const SkSVGLengthContext ,
const SkPaint paint,
SkPathFillType  fillType 
) const
overrideprotectedvirtual

Implements SkSVGShape.

Definition at line 27 of file SkSVGPath.cpp.

28 {
29 // the passed fillType follows inheritance rules and needs to be applied at draw time.
30 SkPath path = fPath; // Note: point and verb data are CoW
31 path.setFillType(fillType);
32 canvas->drawPath(path, paint);
33}
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
const Paint & paint
Definition: color_source.cc:38

◆ onObjectBoundingBox()

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

Reimplemented from SkSVGNode.

Definition at line 43 of file SkSVGPath.cpp.

43 {
45}
SkRect computeTightBounds() const
Definition: SkPath.cpp:3446

◆ parseAndSetAttribute()

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

Reimplemented from SkSVGNode.

Definition at line 17 of file SkSVGPath.cpp.

17 {
19 this->setPath(SkSVGAttributeParser::parse<SkPath>("d", n, v));
20}
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition: SkSVGNode.cpp:90

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