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 SkSVGAttribute_DEFINED | 8 #ifndef SkSVGAttribute_DEFINED |
9 #define SkSVGAttribute_DEFINED | 9 #define SkSVGAttribute_DEFINED |
10 | 10 |
11 #include "SkSVGTypes.h" | 11 #include "SkSVGTypes.h" |
12 #include "SkTLazy.h" | 12 #include "SkTLazy.h" |
13 | 13 |
| 14 class SkSVGRenderContext; |
| 15 |
14 enum class SkSVGAttribute { | 16 enum class SkSVGAttribute { |
15 kD, | 17 kD, |
16 kFill, | 18 kFill, |
17 kHeight, | 19 kHeight, |
18 kStroke, | 20 kStroke, |
19 kTransform, | 21 kTransform, |
| 22 kViewBox, |
20 kWidth, | 23 kWidth, |
21 kX, | 24 kX, |
22 kY, | 25 kY, |
23 | 26 |
24 kUnknown, | 27 kUnknown, |
25 }; | 28 }; |
26 | 29 |
27 class SkSVGRenderContext; | |
28 | |
29 class SkSVGPresentationAttributes { | 30 class SkSVGPresentationAttributes { |
30 public: | 31 public: |
31 SkSVGPresentationAttributes(); | 32 SkSVGPresentationAttributes(); |
32 | 33 |
33 void setFill(const SkSVGColor&); | 34 void setFill(const SkSVGColorType&); |
34 void setStroke(const SkSVGColor&); | 35 void setStroke(const SkSVGColorType&); |
35 | 36 |
36 void applyTo(SkTCopyOnFirstWrite<SkSVGRenderContext>&) const; | 37 void applyTo(SkSVGRenderContext*) const; |
37 | 38 |
38 private: | 39 private: |
39 // Color only for now. | 40 // Color only for now. |
40 SkSVGColor fFill; | 41 SkSVGColorType fFill; |
41 SkSVGColor fStroke; | 42 SkSVGColorType fStroke; |
42 | 43 |
43 unsigned fFillIsSet : 1; | 44 unsigned fFillIsSet : 1; |
44 unsigned fStrokeIsSet : 1; | 45 unsigned fStrokeIsSet : 1; |
45 }; | 46 }; |
46 | 47 |
47 #endif // SkSVGAttribute_DEFINED | 48 #endif // SkSVGAttribute_DEFINED |
OLD | NEW |