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

Side by Side Diff: gm/degeneratesegments.cpp

Issue 805963002: There can be only one (SkRandom)! (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 6 years 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
« no previous file with comments | « gm/cubicpaths.cpp ('k') | gm/emptypath.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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 titlePaint.setLCDRenderText(true); 295 titlePaint.setLCDRenderText(true);
296 titlePaint.setTextSize(15 * SK_Scalar1); 296 titlePaint.setTextSize(15 * SK_Scalar1);
297 const char title[] = "Random Paths Drawn Into Rectangle Clips With " 297 const char title[] = "Random Paths Drawn Into Rectangle Clips With "
298 "Indicated Style, Fill and Linecaps, " 298 "Indicated Style, Fill and Linecaps, "
299 "with Stroke width 6"; 299 "with Stroke width 6";
300 canvas->drawText(title, strlen(title), 300 canvas->drawText(title, strlen(title),
301 20 * SK_Scalar1, 301 20 * SK_Scalar1,
302 20 * SK_Scalar1, 302 20 * SK_Scalar1,
303 titlePaint); 303 titlePaint);
304 304
305 SkLCGRandom rand; 305 SkRandom rand;
306 SkRect rect = SkRect::MakeWH(220*SK_Scalar1, 50*SK_Scalar1); 306 SkRect rect = SkRect::MakeWH(220*SK_Scalar1, 50*SK_Scalar1);
307 canvas->save(); 307 canvas->save();
308 canvas->translate(2*SK_Scalar1, 30 * SK_Scalar1); // The title 308 canvas->translate(2*SK_Scalar1, 30 * SK_Scalar1); // The title
309 canvas->save(); 309 canvas->save();
310 unsigned numSegments = SK_ARRAY_COUNT(gSegmentFunctions); 310 unsigned numSegments = SK_ARRAY_COUNT(gSegmentFunctions);
311 unsigned numCaps = SK_ARRAY_COUNT(gCaps); 311 unsigned numCaps = SK_ARRAY_COUNT(gCaps);
312 unsigned numStyles = SK_ARRAY_COUNT(gStyles); 312 unsigned numStyles = SK_ARRAY_COUNT(gStyles);
313 unsigned numFills = SK_ARRAY_COUNT(gFills); 313 unsigned numFills = SK_ARRAY_COUNT(gFills);
314 for (size_t row = 0; row < 6; ++row) { 314 for (size_t row = 0; row < 6; ++row) {
315 if (0 < row) { 315 if (0 < row) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 private: 397 private:
398 typedef GM INHERITED; 398 typedef GM INHERITED;
399 }; 399 };
400 400
401 ////////////////////////////////////////////////////////////////////////////// 401 //////////////////////////////////////////////////////////////////////////////
402 402
403 static GM* MyFactory(void*) { return new DegenerateSegmentsGM; } 403 static GM* MyFactory(void*) { return new DegenerateSegmentsGM; }
404 static GMRegistry reg(MyFactory); 404 static GMRegistry reg(MyFactory);
405 405
406 } 406 }
OLDNEW
« no previous file with comments | « gm/cubicpaths.cpp ('k') | gm/emptypath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698