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

Unified Diff: src/effects/SkDashPathEffect.cpp

Issue 768183002: Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « src/effects/SkCornerPathEffect.cpp ('k') | src/effects/SkDiscretePathEffect.cpp » ('j') | 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 f866ea074e4592871302eecbddb050ba8b3e9279..f31d883c8ec3d11f39f495ba86c7c36a688a0fa3 100644
--- a/src/effects/SkDashPathEffect.cpp
+++ b/src/effects/SkDashPathEffect.cpp
@@ -369,3 +369,28 @@
}
return NULL;
}
+
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
+SkDashPathEffect::SkDashPathEffect(SkReadBuffer& buffer)
+ : INHERITED(buffer)
+ , fPhase(0)
+ , fInitialDashLength(0)
+ , fInitialDashIndex(0)
+ , fIntervalLength(0) {
+ fPhase = buffer.readScalar();
+ fCount = buffer.getArrayCount();
+ size_t allocSize = sizeof(SkScalar) * fCount;
+ if (buffer.validateAvailable(allocSize)) {
+ fIntervals = (SkScalar*)sk_malloc_throw(allocSize);
+ buffer.readScalarArray(fIntervals, fCount);
+ } else {
+ fIntervals = NULL;
+ }
+
+ // set the internal data members, fPhase should have been between 0 and intervalLength
+ // when written to buffer so no need to adjust it
+ SkDashPath::CalcDashParameters(fPhase, fIntervals, fCount,
+ &fInitialDashLength, &fInitialDashIndex, &fIntervalLength);
+}
+#endif
+
« no previous file with comments | « src/effects/SkCornerPathEffect.cpp ('k') | src/effects/SkDiscretePathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698