aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/ClockFaceView.cpp
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-06-13 09:31:26 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-13 09:31:27 -0700
commit76963e73704a42a18c29d6fbdcccb566e5c67658 (patch)
treee007527879859f5c1857bd9bf3c2c3df32a1fd4c /samplecode/ClockFaceView.cpp
parentfe19987e5499650e8637a8d109f19b8156601660 (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 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);