From f543a60ef06a6b0ccb5a0a85ca5415021c81c9ee Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Fri, 13 Oct 2017 14:07:44 -0400 Subject: [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 Reviewed-by: Robert Phillips --- experimental/svg/model/SkSVGNode.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'experimental/svg/model/SkSVGNode.cpp') diff --git a/experimental/svg/model/SkSVGNode.cpp b/experimental/svg/model/SkSVGNode.cpp index ddde838f8e..07dc59c645 100644 --- a/experimental/svg/model/SkSVGNode.cpp +++ b/experimental/svg/model/SkSVGNode.cpp @@ -90,6 +90,10 @@ void SkSVGNode::setStroke(const SkSVGPaint& svgPaint) { fPresentationAttributes.fStroke.set(svgPaint); } +void SkSVGNode::setStrokeDashArray(const SkSVGDashArray& dashArray) { + fPresentationAttributes.fStrokeDashArray.set(dashArray); +} + void SkSVGNode::setStrokeOpacity(const SkSVGNumberType& opacity) { fPresentationAttributes.fStrokeOpacity.set( SkSVGNumberType(SkTPin(opacity.value(), 0, 1))); @@ -140,6 +144,11 @@ void SkSVGNode::onSetAttribute(SkSVGAttribute attr, const SkSVGValue& v) { this->setStroke(*paint); } break; + case SkSVGAttribute::kStrokeDashArray: + if (const SkSVGDashArrayValue* dashArray = v.as()) { + this->setStrokeDashArray(*dashArray); + } + break; case SkSVGAttribute::kStrokeOpacity: if (const SkSVGNumberValue* opacity = v.as()) { this->setStrokeOpacity(*opacity); -- cgit v1.2.3