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 SkSVGTypes_DEFINED | 8 #ifndef SkSVGTypes_DEFINED |
9 #define SkSVGTypes_DEFINED | 9 #define SkSVGTypes_DEFINED |
10 | 10 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 bool operator==(const SkSVGLineJoin& other) const { return fType == other.fT
ype; } | 161 bool operator==(const SkSVGLineJoin& other) const { return fType == other.fT
ype; } |
162 bool operator!=(const SkSVGLineJoin& other) const { return !(*this == other)
; } | 162 bool operator!=(const SkSVGLineJoin& other) const { return !(*this == other)
; } |
163 | 163 |
164 Type type() const { return fType; } | 164 Type type() const { return fType; } |
165 | 165 |
166 private: | 166 private: |
167 Type fType; | 167 Type fType; |
168 }; | 168 }; |
169 | 169 |
| 170 class SkSVGSpreadMethod { |
| 171 public: |
| 172 // These values must match Skia's SkShader::TileMode enum. |
| 173 enum class Type { |
| 174 kPad, // kClamp_TileMode |
| 175 kRepeat, // kRepeat_TileMode |
| 176 kReflect, // kMirror_TileMode |
| 177 }; |
| 178 |
| 179 constexpr SkSVGSpreadMethod() : fType(Type::kPad) {} |
| 180 constexpr explicit SkSVGSpreadMethod(Type t) : fType(t) {} |
| 181 |
| 182 SkSVGSpreadMethod(const SkSVGSpreadMethod&) = default; |
| 183 SkSVGSpreadMethod& operator=(const SkSVGSpreadMethod&) = default; |
| 184 |
| 185 bool operator==(const SkSVGSpreadMethod& other) const { return fType == othe
r.fType; } |
| 186 bool operator!=(const SkSVGSpreadMethod& other) const { return !(*this == ot
her); } |
| 187 |
| 188 Type type() const { return fType; } |
| 189 |
| 190 private: |
| 191 Type fType; |
| 192 }; |
| 193 |
170 #endif // SkSVGTypes_DEFINED | 194 #endif // SkSVGTypes_DEFINED |
OLD | NEW |