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

Side by Side Diff: gm/ovals.cpp

Issue 13947042: Reset shader in ovals GM (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698