Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: samplecode/ClockFaceView.cpp

Issue 1911963008: DNC - JSON of flattenables, with field names. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add names to call sites Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SampleCode.h" 7 #include "SampleCode.h"
8 #include "SkView.h" 8 #include "SkView.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 virtual void next(const SkPoint& loc, int u, int v, 84 virtual void next(const SkPoint& loc, int u, int v,
85 SkPath* dst) const override { 85 SkPath* dst) const override {
86 if (fPts) { 86 if (fPts) {
87 *fPts->append() = loc; 87 *fPts->append() = loc;
88 } 88 }
89 dst->addCircle(loc.fX, loc.fY, fRadius); 89 dst->addCircle(loc.fX, loc.fY, fRadius);
90 } 90 }
91 91
92 void flatten(SkWriteBuffer& buffer) const override { 92 void flatten(SkWriteBuffer& buffer) const override {
93 buffer.writeMatrix(this->getMatrix()); 93 buffer.writeMatrix("matrix", this->getMatrix());
94 buffer.writeScalar(fRadius); 94 buffer.writeScalar("fRadius", fRadius);
95 } 95 }
96 96
97 private: 97 private:
98 SkScalar fRadius; 98 SkScalar fRadius;
99 SkTDArray<SkPoint>* fPts; 99 SkTDArray<SkPoint>* fPts;
100 100
101 typedef Sk2DPathEffect INHERITED; 101 typedef Sk2DPathEffect INHERITED;
102 }; 102 };
103 103
104 sk_sp<SkFlattenable> Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) { 104 sk_sp<SkFlattenable> Dot2DPathEffect::CreateProc(SkReadBuffer& buffer) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 251 }
252 252
253 private: 253 private:
254 typedef SkView INHERITED; 254 typedef SkView INHERITED;
255 }; 255 };
256 256
257 ////////////////////////////////////////////////////////////////////////////// 257 //////////////////////////////////////////////////////////////////////////////
258 258
259 static SkView* MyFactory() { return new ClockFaceView; } 259 static SkView* MyFactory() { return new ClockFaceView; }
260 static SkViewRegister reg(MyFactory); 260 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698