From 76963e73704a42a18c29d6fbdcccb566e5c67658 Mon Sep 17 00:00:00 2001 From: jvanverth Date: Mon, 13 Jun 2016 09:31:26 -0700 Subject: 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 Review-Url: https://codereview.chromium.org/2056343004 --- samplecode/ClockFaceView.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'samplecode/ClockFaceView.cpp') 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 Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) { SkMatrix matrix; buffer.readMatrix(&matrix); -- cgit v1.2.3