Flutter Engine
The Flutter Engine
SkSVGPath.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
14
15SkSVGPath::SkSVGPath() : INHERITED(SkSVGTag::kPath) { }
16
17bool SkSVGPath::parseAndSetAttribute(const char* n, const char* v) {
19 this->setPath(SkSVGAttributeParser::parse<SkPath>("d", n, v));
20}
21
22template <>
23bool SkSVGAttributeParser::parse<SkPath>(SkPath* path) {
24 return SkParsePath::FromSVGString(fCurPos, path);
25}
26
28 SkPathFillType fillType) const {
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}
34
37 // clip-rule can be inherited and needs to be applied at clip time.
39 this->mapToParent(&path);
40 return path;
41}
42
45}
SkPath fPath
SkPathFillType
Definition: SkPathTypes.h:11
#define INHERITED(method,...)
Definition: SkRecorder.cpp:128
SkSVGTag
Definition: SkSVGNode.h:23
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
static bool FromSVGString(const char str[], SkPath *)
Definition: SkPath.h:59
SkRect computeTightBounds() const
Definition: SkPath.cpp:3446
SkPathFillType asFillType() const
Definition: SkSVGTypes.h:361
virtual bool parseAndSetAttribute(const char *name, const char *value)
Definition: SkSVGNode.cpp:90
void onDraw(SkCanvas *, const SkSVGLengthContext &, const SkPaint &, SkPathFillType) const override
Definition: SkSVGPath.cpp:27
SkPath onAsPath(const SkSVGRenderContext &) const override
Definition: SkSVGPath.cpp:35
SkRect onObjectBoundingBox(const SkSVGRenderContext &) const override
Definition: SkSVGPath.cpp:43
bool parseAndSetAttribute(const char *, const char *) override
Definition: SkSVGPath.cpp:17
const SkSVGPresentationContext & presentationContext() const
void mapToParent(SkPath *) const
const Paint & paint
Definition: color_source.cc:38
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
@ kPath
Definition: SkGlyph.h:317
SkSVGProperty< SkSVGFillRule, true > fClipRule
SkSVGPresentationAttributes fInherited