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