OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkSVGPath_DEFINED | 8 #ifndef SkSVGPath_DEFINED |
9 #define SkSVGPath_DEFINED | 9 #define SkSVGPath_DEFINED |
10 | 10 |
11 #include "SkPath.h" | 11 #include "SkPath.h" |
12 #include "SkSVGTransformableNode.h" | 12 #include "SkSVGShape.h" |
13 | 13 |
14 class SkSVGPath final : public SkSVGTransformableNode { | 14 class SkSVGPath final : public SkSVGShape { |
15 public: | 15 public: |
16 virtual ~SkSVGPath() = default; | 16 virtual ~SkSVGPath() = default; |
17 static sk_sp<SkSVGPath> Make() { return sk_sp<SkSVGPath>(new SkSVGPath()); } | 17 static sk_sp<SkSVGPath> Make() { return sk_sp<SkSVGPath>(new SkSVGPath()); } |
18 | 18 |
19 void appendChild(sk_sp<SkSVGNode>) override { } | |
20 | |
21 void setPath(const SkPath& path) { fPath = path; } | 19 void setPath(const SkPath& path) { fPath = path; } |
22 | 20 |
23 protected: | 21 protected: |
24 void onRender(SkCanvas*, const SkSVGRenderContext&) const override; | 22 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override; |
25 | 23 |
26 void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override; | 24 void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&) const over
ride; |
27 | 25 |
28 private: | 26 private: |
29 SkSVGPath(); | 27 SkSVGPath(); |
30 | 28 |
31 void doRender(SkCanvas*, const SkPaint*) const; | |
32 | |
33 SkPath fPath; | 29 SkPath fPath; |
34 | 30 |
35 typedef SkSVGTransformableNode INHERITED; | 31 typedef SkSVGShape INHERITED; |
36 }; | 32 }; |
37 | 33 |
38 #endif // SkSVGPath_DEFINED | 34 #endif // SkSVGPath_DEFINED |
OLD | NEW |