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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/svg/model/SkSVGLinearGradient.cpp ('k') | experimental/svg/model/SkSVGValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/svg/model/SkSVGTypes.h
diff --git a/experimental/svg/model/SkSVGTypes.h b/experimental/svg/model/SkSVGTypes.h
index b2343a15e4ea996b49879c89b0775f329efddb27..b07f9a2c8cba6ef6fd94fb2bbe9cf2fd5e17f162 100644
--- a/experimental/svg/model/SkSVGTypes.h
+++ b/experimental/svg/model/SkSVGTypes.h
@@ -167,4 +167,28 @@ private:
Type fType;
};
+class SkSVGSpreadMethod {
+public:
+ // These values must match Skia's SkShader::TileMode enum.
+ enum class Type {
+ kPad, // kClamp_TileMode
+ kRepeat, // kRepeat_TileMode
+ kReflect, // kMirror_TileMode
+ };
+
+ constexpr SkSVGSpreadMethod() : fType(Type::kPad) {}
+ constexpr explicit SkSVGSpreadMethod(Type t) : fType(t) {}
+
+ SkSVGSpreadMethod(const SkSVGSpreadMethod&) = default;
+ SkSVGSpreadMethod& operator=(const SkSVGSpreadMethod&) = default;
+
+ bool operator==(const SkSVGSpreadMethod& other) const { return fType == other.fType; }
+ bool operator!=(const SkSVGSpreadMethod& other) const { return !(*this == other); }
+
+ Type type() const { return fType; }
+
+private:
+ Type fType;
+};
+
#endif // SkSVGTypes_DEFINED
« 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