aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/svg/model/SkSVGRenderContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'experimental/svg/model/SkSVGRenderContext.cpp')
-rw-r--r--experimental/svg/model/SkSVGRenderContext.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/experimental/svg/model/SkSVGRenderContext.cpp b/experimental/svg/model/SkSVGRenderContext.cpp
index 61551c4858..2b7ba2cf2c 100644
--- a/experimental/svg/model/SkSVGRenderContext.cpp
+++ b/experimental/svg/model/SkSVGRenderContext.cpp
@@ -179,14 +179,21 @@ void commitToPaint<SkSVGAttribute::kStrokeDashArray>(const SkSVGPresentationAttr
SkASSERT((intervals.count() & 1) == 0);
- // TODO: phase support
- const SkScalar phase = 0;
+ const SkScalar phase = ctx.lengthContext().resolve(*pctx->fInherited.fStrokeDashOffset.get(),
+ SkSVGLengthContext::LengthType::kOther);
pctx->fStrokePaint.setPathEffect(SkDashPathEffect::Make(intervals.begin(),
intervals.count(),
phase));
}
template <>
+void commitToPaint<SkSVGAttribute::kStrokeDashOffset>(const SkSVGPresentationAttributes&,
+ const SkSVGRenderContext&,
+ SkSVGPresentationContext*) {
+ // Applied via kStrokeDashArray.
+}
+
+template <>
void commitToPaint<SkSVGAttribute::kStrokeLineCap>(const SkSVGPresentationAttributes& attrs,
const SkSVGRenderContext&,
SkSVGPresentationContext* pctx) {
@@ -330,6 +337,7 @@ void SkSVGRenderContext::applyPresentationAttributes(const SkSVGPresentationAttr
ApplyLazyInheritedAttribute(FillRule);
ApplyLazyInheritedAttribute(ClipRule);
ApplyLazyInheritedAttribute(Stroke);
+ ApplyLazyInheritedAttribute(StrokeDashOffset);
ApplyLazyInheritedAttribute(StrokeDashArray);
ApplyLazyInheritedAttribute(StrokeLineCap);
ApplyLazyInheritedAttribute(StrokeLineJoin);