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/SampleAll.cpp b/samplecode/SampleAll.cpp
index 4321532..8d2157f 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -164,7 +164,7 @@
         
         buffer.writeScalar(fRadius);
     }
-    virtual Factory getFactory() { return CreateProc; }
+    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Dot2DPathEffect)
 
 protected:
 	virtual void next(const SkPoint& loc, int u, int v, SkPath* dst) {
@@ -177,10 +177,6 @@
 private:
     SkScalar fRadius;
 
-    static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) {
-        return new Dot2DPathEffect(buffer);
-    }
-
     typedef Sk2DPathEffect INHERITED;
 };
 
@@ -222,11 +218,13 @@
         return false;
     }
     
-    virtual Factory getFactory() { return CreateProc; }
     virtual void flatten(SkFlattenableWriteBuffer& buffer) {
         this->INHERITED::flatten(buffer);
         buffer.writeScalar(fWidth);
     }
+
+    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Line2DPathEffect)
+
 protected:
 	virtual void nextSpan(int u, int v, int ucount, SkPath* dst) {
         if (ucount > 1) {
@@ -250,8 +248,6 @@
 private:
     SkScalar fWidth;
 
-    static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) { return new Line2DPathEffect(buffer); }
-
     typedef Sk2DPathEffect INHERITED;
 };