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 SkSVGDOM_DEFINED | 8 #ifndef SkSVGDOM_DEFINED |
9 #define SkSVGDOM_DEFINED | 9 #define SkSVGDOM_DEFINED |
10 | 10 |
11 #include "SkRefCnt.h" | 11 #include "SkRefCnt.h" |
12 #include "SkSize.h" | 12 #include "SkSize.h" |
| 13 #include "SkSVGIDMapper.h" |
13 #include "SkTemplates.h" | 14 #include "SkTemplates.h" |
14 | 15 |
15 class SkCanvas; | 16 class SkCanvas; |
16 class SkDOM; | 17 class SkDOM; |
17 class SkStream; | 18 class SkStream; |
18 class SkSVGNode; | 19 class SkSVGNode; |
19 | 20 |
20 class SkSVGDOM : public SkRefCnt { | 21 class SkSVGDOM : public SkRefCnt { |
21 public: | 22 public: |
22 SkSVGDOM(const SkSize& containerSize); | 23 SkSVGDOM(const SkSize& containerSize); |
23 ~SkSVGDOM() = default; | 24 ~SkSVGDOM() = default; |
24 | 25 |
25 static sk_sp<SkSVGDOM> MakeFromDOM(const SkDOM&, const SkSize& containerSize
); | 26 static sk_sp<SkSVGDOM> MakeFromDOM(const SkDOM&, const SkSize& containerSize
); |
26 static sk_sp<SkSVGDOM> MakeFromStream(SkStream&, const SkSize& containerSize
); | 27 static sk_sp<SkSVGDOM> MakeFromStream(SkStream&, const SkSize& containerSize
); |
27 | 28 |
28 void setContainerSize(const SkSize&); | 29 void setContainerSize(const SkSize&); |
29 void setRoot(sk_sp<SkSVGNode>); | 30 void setRoot(sk_sp<SkSVGNode>); |
30 | 31 |
31 void render(SkCanvas*) const; | 32 void render(SkCanvas*) const; |
32 | 33 |
33 private: | 34 private: |
34 SkSize fContainerSize; | 35 SkSize fContainerSize; |
35 sk_sp<SkSVGNode> fRoot; | 36 sk_sp<SkSVGNode> fRoot; |
| 37 SkSVGIDMapper fIDMapper; |
36 | 38 |
37 typedef SkRefCnt INHERITED; | 39 typedef SkRefCnt INHERITED; |
38 }; | 40 }; |
39 | 41 |
40 #endif // SkSVGDOM_DEFINED | 42 #endif // SkSVGDOM_DEFINED |
OLD | NEW |