aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/ClockFaceView.cpp
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-06-16 09:52:35 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-16 09:52:35 -0700
commitc7027ab03f2e8bab4c74bc1b047642622d3d682b (patch)
tree72baa4e6345d6e3bbdb2b0165130a637a9778f19 /samplecode/ClockFaceView.cpp
parentc4ce6b592487305de251bbebaf8eeee38371b877 (diff)
Add samples to Viewer.
This adds support with animation, assuming the sample has implemented onAnimate. Event handling has not been implemented. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2056343004 Committed: https://skia.googlesource.com/skia/+/76963e73704a42a18c29d6fbdcccb566e5c67658 Review-Url: https://codereview.chromium.org/2056343004
Diffstat (limited to 'samplecode/ClockFaceView.cpp')
-rw-r--r--samplecode/ClockFaceView.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index ef0fec7577..9cee95b84c 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -72,7 +72,14 @@ public:
: Sk2DPathEffect(matrix), fRadius(radius), fPts(pts) {}
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Dot2DPathEffect)
-
+ class Registrar {
+ public:
+ Registrar() {
+ SkFlattenable::Register("Dot2DPathEffect",
+ Dot2DPathEffect::CreateProc,
+ Dot2DPathEffect::GetFlattenableType());
+ }
+ };
protected:
void begin(const SkIRect& uvBounds, SkPath* dst) const override {
if (fPts) {
@@ -101,6 +108,8 @@ private:
typedef Sk2DPathEffect INHERITED;
};
+static Dot2DPathEffect::Registrar gReg0;
+
sk_sp<SkFlattenable> Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) {
SkMatrix matrix;
buffer.readMatrix(&matrix);