diff options
author | Florin Malita <fmalita@chromium.org> | 2017-10-13 14:07:44 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-13 19:14:39 +0000 |
commit | f543a60ef06a6b0ccb5a0a85ca5415021c81c9ee (patch) | |
tree | f2a3d3dd48e360e045e01385d86fa7833de20d3b /experimental/svg/model/SkSVGTypes.h | |
parent | 770db22a553e87d6f3e40db72c5871b1d8a9ec91 (diff) |
[SVGDom] Add 'stroke-dasharray' support
https://www.w3.org/TR/SVG/painting.html#StrokeDasharrayProperty
Change-Id: I9a63ebbd958d661c865ed405570b86cca68f63bf
Reviewed-on: https://skia-review.googlesource.com/59700
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'experimental/svg/model/SkSVGTypes.h')
-rw-r--r-- | experimental/svg/model/SkSVGTypes.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/experimental/svg/model/SkSVGTypes.h b/experimental/svg/model/SkSVGTypes.h index 4a300b6e3c..0878068982 100644 --- a/experimental/svg/model/SkSVGTypes.h +++ b/experimental/svg/model/SkSVGTypes.h @@ -272,4 +272,35 @@ private: Type fType; }; +class SkSVGDashArray { +public: + enum class Type { + kNone, + kDashArray, + kInherit, + }; + + SkSVGDashArray() : fType(Type::kNone) {} + explicit SkSVGDashArray(Type t) : fType(t) {} + explicit SkSVGDashArray(SkTDArray<SkSVGLength>&& dashArray) + : fType(Type::kDashArray) + , fDashArray(std::move(dashArray)) {} + + SkSVGDashArray(const SkSVGDashArray&) = default; + SkSVGDashArray& operator=(const SkSVGDashArray&) = default; + + bool operator==(const SkSVGDashArray& other) const { + return fType == other.fType && fDashArray == other.fDashArray; + } + bool operator!=(const SkSVGDashArray& other) const { return !(*this == other); } + + Type type() const { return fType; } + + const SkTDArray<SkSVGLength>& dashArray() const { return fDashArray; } + +private: + Type fType; + SkTDArray<SkSVGLength> fDashArray; +}; + #endif // SkSVGTypes_DEFINED |