Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: src/effects/SkDashPathEffect.cpp

Issue 212103010: Add asADash entry point into SkPathEffect to allow extracting Dash info from PathEffects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« include/core/SkPathEffect.h ('K') | « src/core/SkPathEffect.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« include/core/SkPathEffect.h ('K') | « src/core/SkPathEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698