Index: src/effects/SkDashPathEffect.cpp |
diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp |
index 58706c5b78f52d55bbead6d4f7a8f3634bd838c6..9dc2423a35ce1cd12a4132e7e154ec460c6649bc 100644 |
--- a/src/effects/SkDashPathEffect.cpp |
+++ b/src/effects/SkDashPathEffect.cpp |
@@ -529,6 +529,26 @@ bool SkDashPathEffect::asPoints(PointData* results, |
return true; |
} |
+SkPathEffect::DashType SkDashPathEffect::asADash(DashInfo* info) const { |
+ if (info) { |
+ if (info->fCount >= fCount) { |
+ if (info->fIntervals) { |
+ memcpy(info->fIntervals, fIntervals, fCount * sizeof(SkScalar)); |
+ } |
+ } |
+ info->fCount = fCount; |
+ info->fInitialDashLength = fInitialDashLength; |
+ info->fInitialDashIndex = fInitialDashIndex; |
+ info->fIntervalLength = fIntervalLength; |
+ info->fScaleToFit = fScaleToFit; |
+ } |
+ if (2 == fCount) { |
+ return kTwoInterval_DashType; |
+ } else { |
+ return kMultipleInterval_DashType; |
+ } |
+} |
+ |
SkFlattenable::Factory SkDashPathEffect::getFactory() const { |
return CreateProc; |
} |