aboutsummaryrefslogtreecommitdiff
path: root/samplecode/ClockFaceView.cpp
diff options
context:
space:
mode:
authordjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-26 17:57:35 +0000
committerdjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-26 17:57:35 +0000
commitba28d03e94dc221d6a803bf2a84a420b9159255c (patch)
tree1130187c2342abd92cc0782e724ad57fc551872a /samplecode/ClockFaceView.cpp
parentd43b0a87f85ca26ec771e094c62df33b0537b563 (diff)
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
Diffstat (limited to 'samplecode/ClockFaceView.cpp')
-rw-r--r--samplecode/ClockFaceView.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index a479d9ced1..fe7bb90fed 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -76,7 +76,8 @@ public:
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 @@ private:
SkScalar fRadius;
SkTDArray<SkPoint>* fPts;
- static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer)
- {
- return new Dot2DPathEffect(buffer);
- }
-
typedef Sk2DPathEffect INHERITED;
};
@@ -119,13 +115,12 @@ public:
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;
};