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

Unified Diff: samplecode/ClockFaceView.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 | « include/effects/SkXfermodeImageFilter.h ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/ClockFaceView.cpp
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index a887cc67fd084774c5129aa7fb20ea1c21f32d67..46d4120c9b35710983f18025abf019699c44b903 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -90,13 +90,15 @@ protected:
dst->addCircle(loc.fX, loc.fY, fRadius);
}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
Dot2DPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {
fRadius = buffer.readScalar();
fPts = NULL;
}
+#endif
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE {
- this->INHERITED::flatten(buffer);
+ buffer.writeMatrix(this->getMatrix());
buffer.writeScalar(fRadius);
}
@@ -107,6 +109,12 @@ private:
typedef Sk2DPathEffect INHERITED;
};
+SkFlattenable* Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) {
+ SkMatrix matrix;
+ buffer.readMatrix(&matrix);
+ return SkNEW_ARGS(Dot2DPathEffect, (buffer.readScalar(), matrix, NULL));
+}
+
class InverseFillPE : public SkPathEffect {
public:
InverseFillPE() {}
@@ -119,12 +127,19 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(InverseFillPE)
protected:
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
InverseFillPE(SkReadBuffer& buffer) : INHERITED(buffer) {}
+#endif
+
private:
typedef SkPathEffect INHERITED;
};
+SkFlattenable* InverseFillPE::CreateProc(SkReadBuffer& buffer) {
+ return SkNEW(InverseFillPE);
+}
+
static SkPathEffect* makepe(float interp, SkTDArray<SkPoint>* pts) {
SkMatrix lattice;
SkScalar rad = 3 + SkIntToScalar(4) * (1 - interp);
« no previous file with comments | « include/effects/SkXfermodeImageFilter.h ('k') | samplecode/SampleAll.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698