Create macro for registering classes for deserialization
Review URL: https://codereview.appspot.com/5909063
git-svn-id: http://skia.googlecode.com/svn/trunk@3494 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index a479d9c..fe7bb90 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -76,7 +76,8 @@
buffer.writeScalar(fRadius);
}
- virtual Factory getFactory() { return CreateProc; }
+
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Dot2DPathEffect)
protected:
virtual void begin(const SkIRect& uvBounds, SkPath* dst) {
@@ -103,11 +104,6 @@
SkScalar fRadius;
SkTDArray<SkPoint>* fPts;
- static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer)
- {
- return new Dot2DPathEffect(buffer);
- }
-
typedef Sk2DPathEffect INHERITED;
};
@@ -119,13 +115,12 @@
dst->setFillType(SkPath::kInverseWinding_FillType);
return true;
}
- virtual Factory getFactory() { return Factory; }
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(InverseFillPE)
+
protected:
-// InverseFillPE(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
+ InverseFillPE(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
private:
- static SkFlattenable* Factory(SkFlattenableReadBuffer& buffer) {
- return new InverseFillPE;
- }
+
typedef SkPathEffect INHERITED;
};