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

Unified Diff: src/effects/SkDiscretePathEffect.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 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
« no previous file with comments | « src/effects/SkDashPathEffect.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDiscretePathEffect.cpp
diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp
index f6f91124479404330b1763370a51a70deb44f76d..e8cc6a2f7032c779b6315d018247328104a5cf17 100644
--- a/src/effects/SkDiscretePathEffect.cpp
+++ b/src/effects/SkDiscretePathEffect.cpp
@@ -75,15 +75,24 @@ bool SkDiscretePathEffect::filterPath(SkPath* dst, const SkPath& src,
return true;
}
+SkFlattenable* SkDiscretePathEffect::CreateProc(SkReadBuffer& buffer) {
+ SkScalar segLength = buffer.readScalar();
+ SkScalar perterb = buffer.readScalar();
+ uint32_t seed = buffer.readUInt();
+ return Create(segLength, perterb, seed);
+}
+
void SkDiscretePathEffect::flatten(SkWriteBuffer& buffer) const {
- this->INHERITED::flatten(buffer);
buffer.writeScalar(fSegLength);
buffer.writeScalar(fPerterb);
buffer.writeUInt(fSeedAssist);
}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkDiscretePathEffect::SkDiscretePathEffect(SkReadBuffer& buffer) {
fSegLength = buffer.readScalar();
fPerterb = buffer.readScalar();
fSeedAssist = buffer.readUInt();
}
+#endif
+
« no previous file with comments | « src/effects/SkDashPathEffect.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698