aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/svg/model/SkSVGTypes.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2016-12-01 13:35:11 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-06 16:05:41 +0000
commite932d4b3a99905a6272c5574f21ac651632f4e82 (patch)
tree667289b43423b6183ac76eb657b32aef201b1b13 /experimental/svg/model/SkSVGTypes.h
parentebe79ffd8627e3fea945a82895e64cede4ec21bf (diff)
[SVGDom] Add fill-rule support
There's a bit of friction with this attribute, because per spec it is an inherited presentation attribute, but in Skia it is part of the actual SkPath state. So we must add some plumbing to SkSVGShape & friends to allow overriding the fill type at render-time. R=robertphillips@google.com,stephana@google.com Change-Id: I9c926d653c6211beb3914bffac50d4349dbdd2c0 Reviewed-on: https://skia-review.googlesource.com/5415 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental/svg/model/SkSVGTypes.h')
-rw-r--r--experimental/svg/model/SkSVGTypes.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/experimental/svg/model/SkSVGTypes.h b/experimental/svg/model/SkSVGTypes.h
index b07f9a2c8c..d5d2b7146f 100644
--- a/experimental/svg/model/SkSVGTypes.h
+++ b/experimental/svg/model/SkSVGTypes.h
@@ -191,4 +191,27 @@ private:
Type fType;
};
+class SkSVGFillRule {
+public:
+ enum class Type {
+ kNonZero,
+ kEvenOdd,
+ kInherit,
+ };
+
+ constexpr SkSVGFillRule() : fType(Type::kInherit) {}
+ constexpr explicit SkSVGFillRule(Type t) : fType(t) {}
+
+ SkSVGFillRule(const SkSVGFillRule&) = default;
+ SkSVGFillRule& operator=(const SkSVGFillRule&) = default;
+
+ bool operator==(const SkSVGFillRule& other) const { return fType == other.fType; }
+ bool operator!=(const SkSVGFillRule& other) const { return !(*this == other); }
+
+ Type type() const { return fType; }
+
+private:
+ Type fType;
+};
+
#endif // SkSVGTypes_DEFINED