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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 canvas->translate(kXStart + SK_Scalar1 * kXStep * 0 + SK_Scalar1 / 4
, | 258 canvas->translate(kXStart + SK_Scalar1 * kXStep * 0 + SK_Scalar1 / 4
, |
259 kYStart + SK_Scalar1 * kYStep * i + 3 * SK_Scalar1
/ 4 + | 259 kYStart + SK_Scalar1 * kYStep * i + 3 * SK_Scalar1
/ 4 + |
260 SK_ScalarHalf * kYStep); | 260 SK_ScalarHalf * kYStep); |
261 | 261 |
262 SkColor color = genColor(&rand); | 262 SkColor color = genColor(&rand); |
263 fPaints[i].setColor(color); | 263 fPaints[i].setColor(color); |
264 fPaints[i].setShader(shader); | 264 fPaints[i].setShader(shader); |
265 | 265 |
266 canvas->drawRect(oval, rectPaint); | 266 canvas->drawRect(oval, rectPaint); |
267 canvas->drawOval(oval, fPaints[i]); | 267 canvas->drawOval(oval, fPaints[i]); |
| 268 |
| 269 fPaints[i].setShader(NULL); |
| 270 |
268 canvas->restore(); | 271 canvas->restore(); |
269 } | 272 } |
270 } | 273 } |
271 | 274 |
272 private: | 275 private: |
273 SkTArray<SkPaint> fPaints; | 276 SkTArray<SkPaint> fPaints; |
274 SkTArray<SkMatrix> fMatrices; | 277 SkTArray<SkMatrix> fMatrices; |
275 | 278 |
276 typedef GM INHERITED; | 279 typedef GM INHERITED; |
277 }; | 280 }; |
278 | 281 |
279 ////////////////////////////////////////////////////////////////////////////// | 282 ////////////////////////////////////////////////////////////////////////////// |
280 | 283 |
281 static GM* MyFactory(void*) { return new OvalGM; } | 284 static GM* MyFactory(void*) { return new OvalGM; } |
282 static GMRegistry reg(MyFactory); | 285 static GMRegistry reg(MyFactory); |
283 | 286 |
284 } | 287 } |
OLD | NEW |