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

Unified Diff: gm/strokes.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/strokerects.cpp ('k') | include/utils/SkRandom.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/strokes.cpp
diff --git a/gm/strokes.cpp b/gm/strokes.cpp
index 81741693cfc765019bde77648b5b4b9ef2c7f96e..2a92c031ae8243d434fffc2a984f237476ae2d91 100644
--- a/gm/strokes.cpp
+++ b/gm/strokes.cpp
@@ -18,7 +18,7 @@
static const SkScalar SW = SkIntToScalar(W);
static const SkScalar SH = SkIntToScalar(H);
-static void rnd_rect(SkRect* r, SkPaint* paint, SkLCGRandom& rand) {
+static void rnd_rect(SkRect* r, SkPaint* paint, SkRandom& rand) {
SkScalar x = rand.nextUScalar1() * W;
SkScalar y = rand.nextUScalar1() * H;
SkScalar w = rand.nextUScalar1() * (W >> 2);
@@ -65,7 +65,7 @@ protected:
, SW - SkIntToScalar(2), SH - SkIntToScalar(2)
));
- SkLCGRandom rand;
+ SkRandom rand;
for (int i = 0; i < N; i++) {
SkRect r;
rnd_rect(&r, &paint, rand);
@@ -85,7 +85,7 @@ class Strokes2GM : public skiagm::GM {
SkPath fPath;
public:
Strokes2GM() {
- SkLCGRandom rand;
+ SkRandom rand;
fPath.moveTo(0, 0);
for (int i = 0; i < 13; i++) {
SkScalar x = rand.nextUScalar1() * (W >> 1);
@@ -129,7 +129,7 @@ protected:
SW - SkIntToScalar(2),
SH - SkIntToScalar(2)));
- SkLCGRandom rand;
+ SkRandom rand;
for (int i = 0; i < N/2; i++) {
SkRect r;
rnd_rect(&r, &paint, rand);
« no previous file with comments | « gm/strokerects.cpp ('k') | include/utils/SkRandom.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698