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

Side by Side Diff: gm/nested.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/mixedxfermodes.cpp ('k') | gm/ovals.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 2013 Google Inc. 2 * Copyright 2013 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 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkRandom.h" 9 #include "SkRandom.h"
10 #include "SkRRect.h" 10 #include "SkRRect.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 shapePaint.setAntiAlias(fDoAA); 66 shapePaint.setAntiAlias(fDoAA);
67 67
68 SkRect outerRect = SkRect::MakeWH(40, 40); 68 SkRect outerRect = SkRect::MakeWH(40, 40);
69 69
70 SkRect innerRects[] = { 70 SkRect innerRects[] = {
71 { 10, 10, 30, 30 }, // small 71 { 10, 10, 30, 30 }, // small
72 { .5f, 18, 4.5f, 22 } // smaller and offset to left 72 { .5f, 18, 4.5f, 22 } // smaller and offset to left
73 }; 73 };
74 74
75 // draw a background pattern to make transparency errors more apparent 75 // draw a background pattern to make transparency errors more apparent
76 SkMWCRandom rand; 76 SkRandom rand;
77 77
78 for (int y = 0; y < kImageHeight; y += 10) { 78 for (int y = 0; y < kImageHeight; y += 10) {
79 for (int x = 0; x < kImageWidth; x += 10) { 79 for (int x = 0; x < kImageWidth; x += 10) {
80 SkRect r = SkRect::MakeXYWH(SkIntToScalar(x), 80 SkRect r = SkRect::MakeXYWH(SkIntToScalar(x),
81 SkIntToScalar(y), 81 SkIntToScalar(y),
82 10, 10); 82 10, 10);
83 SkPaint p; 83 SkPaint p;
84 p.setColor(rand.nextU() | 0xFF000000); 84 p.setColor(rand.nextU() | 0xFF000000);
85 canvas->drawRect(r, p); 85 canvas->drawRect(r, p);
86 } 86 }
(...skipping 29 matching lines...) Expand all
116 typedef GM INHERITED; 116 typedef GM INHERITED;
117 }; 117 };
118 118
119 /////////////////////////////////////////////////////////////////////////////// 119 ///////////////////////////////////////////////////////////////////////////////
120 120
121 DEF_GM( return new NestedGM(true); ) 121 DEF_GM( return new NestedGM(true); )
122 DEF_GM( return new NestedGM(false); ) 122 DEF_GM( return new NestedGM(false); )
123 123
124 124
125 } 125 }
OLDNEW
« no previous file with comments | « gm/mixedxfermodes.cpp ('k') | gm/ovals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698