Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: experimental/svg/model/SkSVGTypes.h

Issue 2337203002: [SVGDom] Linear gradient 'spreadMethod' support (Closed)
Patch Set: review Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « experimental/svg/model/SkSVGLinearGradient.cpp ('k') | experimental/svg/model/SkSVGValue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « experimental/svg/model/SkSVGLinearGradient.cpp ('k') | experimental/svg/model/SkSVGValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698