OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "gm.h" | 9 #include "gm.h" |
10 #include "SkTArray.h" | 10 #include "SkTArray.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 kYStart + SK_Scalar1 * kYStep * i + 3 * SK_Scalar1
/ 4 + | 260 kYStart + SK_Scalar1 * kYStep * i + 3 * SK_Scalar1
/ 4 + |
261 SK_ScalarHalf * kYStep); | 261 SK_ScalarHalf * kYStep); |
262 | 262 |
263 SkColor color = genColor(&rand); | 263 SkColor color = genColor(&rand); |
264 fPaints[i].setColor(color); | 264 fPaints[i].setColor(color); |
265 fPaints[i].setShader(shader); | 265 fPaints[i].setShader(shader); |
266 | 266 |
267 canvas->drawRect(oval, rectPaint); | 267 canvas->drawRect(oval, rectPaint); |
268 canvas->drawOval(oval, fPaints[i]); | 268 canvas->drawOval(oval, fPaints[i]); |
269 | 269 |
270 fPaints[i].setShader(NULL); | 270 fPaints[i].setShader(nullptr); |
271 | 271 |
272 canvas->restore(); | 272 canvas->restore(); |
273 } | 273 } |
274 } | 274 } |
275 | 275 |
276 private: | 276 private: |
277 SkTArray<SkPaint> fPaints; | 277 SkTArray<SkPaint> fPaints; |
278 SkTArray<SkMatrix> fMatrices; | 278 SkTArray<SkMatrix> fMatrices; |
279 | 279 |
280 typedef GM INHERITED; | 280 typedef GM INHERITED; |
281 }; | 281 }; |
282 | 282 |
283 ////////////////////////////////////////////////////////////////////////////// | 283 ////////////////////////////////////////////////////////////////////////////// |
284 | 284 |
285 static GM* MyFactory(void*) { return new OvalGM; } | 285 static GM* MyFactory(void*) { return new OvalGM; } |
286 static GMRegistry reg(MyFactory); | 286 static GMRegistry reg(MyFactory); |
287 | 287 |
288 } | 288 } |
OLD | NEW |