OLD | NEW |
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 Loading... |
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 Loading... |
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); |
OLD | NEW |