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

Side by Side Diff: gm/circles.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/beziereffects.cpp ('k') | gm/complexclip2.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 /* 2 /*
3 * Copyright 2012 Intel Inc. 3 * Copyright 2012 Intel 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 #include "gm.h" 8 #include "gm.h"
9 #include "SkBlurDrawLooper.h" 9 #include "SkBlurDrawLooper.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 145 }
146 146
147 { 147 {
148 SkMatrix m; 148 SkMatrix m;
149 m.setRotate(SkIntToScalar(30)); 149 m.setRotate(SkIntToScalar(30));
150 fMatrices.push_back(m); 150 fMatrices.push_back(m);
151 } 151 }
152 } 152 }
153 153
154 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 154 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
155 SkRandom rand; 155 SkLCGRandom rand;
156 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1); 156 canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1);
157
158 int i; 157 int i;
159 for (i = 0; i < fPaints.count(); ++i) { 158 for (i = 0; i < fPaints.count(); ++i) {
160 canvas->save(); 159 canvas->save();
161 // position the path, and make it at off-integer coords. 160 // position the path, and make it at off-integer coords.
162 canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 4, 161 canvas->translate(SK_Scalar1 * 200 * (i % 5) + SK_Scalar1 / 4,
163 SK_Scalar1 * 200 * (i / 5) + 3 * SK_Scalar1 / 4); 162 SK_Scalar1 * 200 * (i / 5) + 3 * SK_Scalar1 / 4);
164 SkColor color = rand.nextU(); 163 SkColor color = rand.nextU();
165 color |= 0xff000000; 164 color |= 0xff000000;
166 fPaints[i].setColor(color); 165 fPaints[i].setColor(color);
167 166
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 SkTArray<SkPaint> fPaints; 198 SkTArray<SkPaint> fPaints;
200 SkTArray<SkMatrix> fMatrices; 199 SkTArray<SkMatrix> fMatrices;
201 }; 200 };
202 201
203 ////////////////////////////////////////////////////////////////////////////// 202 //////////////////////////////////////////////////////////////////////////////
204 203
205 static GM* MyFactory(void*) { return new CircleGM; } 204 static GM* MyFactory(void*) { return new CircleGM; }
206 static GMRegistry reg(MyFactory); 205 static GMRegistry reg(MyFactory);
207 206
208 } 207 }
208
OLDNEW
« no previous file with comments | « gm/beziereffects.cpp ('k') | gm/complexclip2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698