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 |