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

#include <SkSVGLine.h>

Inheritance diagram for SkSVGLine:
SkSVGShape SkSVGTransformableNode SkSVGNode SkRefCnt SkRefCntBase

Static Public Member Functions

static sk_sp< SkSVGLineMake ()
 

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
 
- 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 SkSVGLine.h.

Member Function Documentation

◆ Make()

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

Definition at line 18 of file SkSVGLine.h.

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

◆ onAsPath()

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

Implements SkSVGNode.

Definition at line 39 of file SkSVGLine.cpp.

39 {
40 SkPoint p0, p1;
41 std::tie(p0, p1) = this->resolve(ctx.lengthContext());
42
43 SkPath path = SkPath::Line(p0, p1);
44 this->mapToParent(&path);
45
46 return path;
47}
Definition: SkPath.h:59
static SkPath Line(const SkPoint a, const SkPoint b)
Definition: SkPath.h:106
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 SkSVGLine::onDraw ( SkCanvas canvas,
const SkSVGLengthContext lctx,
const SkPaint paint,
SkPathFillType   
) const
overrideprotectedvirtual

Implements SkSVGShape.

Definition at line 31 of file SkSVGLine.cpp.

32 {
33 SkPoint p0, p1;
34 std::tie(p0, p1) = this->resolve(lctx);
35
36 canvas->drawLine(p0, p1, paint);
37}
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
Definition: SkCanvas.cpp:2700
const Paint & paint
Definition: color_source.cc:38

◆ parseAndSetAttribute()

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

Reimplemented from SkSVGNode.

Definition at line 15 of file SkSVGLine.cpp.

15 {
17 this->setX1(SkSVGAttributeParser::parse<SkSVGLength>("x1", n, v)) ||
18 this->setY1(SkSVGAttributeParser::parse<SkSVGLength>("y1", n, v)) ||
19 this->setX2(SkSVGAttributeParser::parse<SkSVGLength>("x2", n, v)) ||
20 this->setY2(SkSVGAttributeParser::parse<SkSVGLength>("y2", n, v));
21}
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition: SkSVGNode.cpp:90

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