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

Side by Side Diff: gm/cubicpaths.cpp

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms Created 7 years, 3 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 | « gm/convexpaths.cpp ('k') | gm/degeneratesegments.cpp » ('j') | 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 * 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 "gm.h" 7 #include "gm.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 titlePaint.setAntiAlias(true); 124 titlePaint.setAntiAlias(true);
125 titlePaint.setLCDRenderText(true); 125 titlePaint.setLCDRenderText(true);
126 titlePaint.setTextSize(15 * SK_Scalar1); 126 titlePaint.setTextSize(15 * SK_Scalar1);
127 const char title[] = "Cubic Drawn Into Rectangle Clips With " 127 const char title[] = "Cubic Drawn Into Rectangle Clips With "
128 "Indicated Style, Fill and Linecaps, with stroke wi dth 10"; 128 "Indicated Style, Fill and Linecaps, with stroke wi dth 10";
129 canvas->drawText(title, strlen(title), 129 canvas->drawText(title, strlen(title),
130 20 * SK_Scalar1, 130 20 * SK_Scalar1,
131 20 * SK_Scalar1, 131 20 * SK_Scalar1,
132 titlePaint); 132 titlePaint);
133 133
134 SkRandom rand; 134 SkLCGRandom rand;
135 SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1); 135 SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1);
136 canvas->save(); 136 canvas->save();
137 canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1); 137 canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1);
138 canvas->save(); 138 canvas->save();
139 for (size_t cap = 0; cap < SK_ARRAY_COUNT(gCaps); ++cap) { 139 for (size_t cap = 0; cap < SK_ARRAY_COUNT(gCaps); ++cap) {
140 if (0 < cap) { 140 if (0 < cap) {
141 canvas->translate((rect.width() + 40 * SK_Scalar1) * SK_ARRAY_CO UNT(gStyles), 0); 141 canvas->translate((rect.width() + 40 * SK_Scalar1) * SK_ARRAY_CO UNT(gStyles), 0);
142 } 142 }
143 canvas->save(); 143 canvas->save();
144 for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) { 144 for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 titlePaint.setAntiAlias(true); 268 titlePaint.setAntiAlias(true);
269 titlePaint.setLCDRenderText(true); 269 titlePaint.setLCDRenderText(true);
270 titlePaint.setTextSize(15 * SK_Scalar1); 270 titlePaint.setTextSize(15 * SK_Scalar1);
271 const char title[] = "Cubic Closed Drawn Into Rectangle Clips With " 271 const char title[] = "Cubic Closed Drawn Into Rectangle Clips With "
272 "Indicated Style, Fill and Linecaps, with stroke wi dth 10"; 272 "Indicated Style, Fill and Linecaps, with stroke wi dth 10";
273 canvas->drawText(title, strlen(title), 273 canvas->drawText(title, strlen(title),
274 20 * SK_Scalar1, 274 20 * SK_Scalar1,
275 20 * SK_Scalar1, 275 20 * SK_Scalar1,
276 titlePaint); 276 titlePaint);
277 277
278 SkRandom rand; 278 SkLCGRandom rand;
279 SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1); 279 SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1);
280 canvas->save(); 280 canvas->save();
281 canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1); 281 canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1);
282 canvas->save(); 282 canvas->save();
283 for (size_t cap = 0; cap < SK_ARRAY_COUNT(gCaps); ++cap) { 283 for (size_t cap = 0; cap < SK_ARRAY_COUNT(gCaps); ++cap) {
284 if (0 < cap) { 284 if (0 < cap) {
285 canvas->translate((rect.width() + 40 * SK_Scalar1) * SK_ARRAY_CO UNT(gStyles), 0); 285 canvas->translate((rect.width() + 40 * SK_Scalar1) * SK_ARRAY_CO UNT(gStyles), 0);
286 } 286 }
287 canvas->save(); 287 canvas->save();
288 for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) { 288 for (size_t fill = 0; fill < SK_ARRAY_COUNT(gFills); ++fill) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 private: 336 private:
337 typedef skiagm::GM INHERITED; 337 typedef skiagm::GM INHERITED;
338 }; 338 };
339 339
340 ////////////////////////////////////////////////////////////////////////////// 340 //////////////////////////////////////////////////////////////////////////////
341 341
342 DEF_GM( return new CubicPathGM; ) 342 DEF_GM( return new CubicPathGM; )
343 DEF_GM( return new CubicClosePathGM; ) 343 DEF_GM( return new CubicClosePathGM; )
344 DEF_GM( return new ClippedCubicGM; ) 344 DEF_GM( return new ClippedCubicGM; )
OLDNEW
« no previous file with comments | « gm/convexpaths.cpp ('k') | gm/degeneratesegments.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698