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

Unified Diff: gm/beziers.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 | « expectations/gm/ignored-tests.txt ('k') | gm/circles.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/beziers.cpp
diff --git a/gm/beziers.cpp b/gm/beziers.cpp
index 48033bb385b295d681397b49046cfb468e5ea346..2371fdd0ebb9458bb12a184fdcfb259fb3cd2b4c 100755
--- a/gm/beziers.cpp
+++ b/gm/beziers.cpp
@@ -14,7 +14,7 @@
static const SkScalar SH = SkIntToScalar(H);
-static void rnd_quad(SkPath* p, SkPaint* paint, SkLCGRandom& rand) {
+static void rnd_quad(SkPath* p, SkPaint* paint, SkRandom& rand) {
p->moveTo(rand.nextRangeScalar(0, W), rand.nextRangeScalar(0, H));
for (int x = 0; x < 2; ++x) {
p->quadTo(rand.nextRangeScalar(W / 4, W), rand.nextRangeScalar(0, H),
@@ -27,7 +27,7 @@ static void rnd_quad(SkPath* p, SkPaint* paint, SkLCGRandom& rand) {
paint->setAlpha(0xFF);
}
-static void rnd_cubic(SkPath* p, SkPaint* paint, SkLCGRandom& rand) {
+static void rnd_cubic(SkPath* p, SkPaint* paint, SkRandom& rand) {
p->moveTo(rand.nextRangeScalar(0, W), rand.nextRangeScalar(0, H));
for (int x = 0; x < 2; ++x) {
p->cubicTo(rand.nextRangeScalar(W / 4, W), rand.nextRangeScalar(0, H),
@@ -64,7 +64,7 @@ protected:
paint.setStrokeWidth(SkIntToScalar(9)/2);
paint.setAntiAlias(true);
- SkLCGRandom rand;
+ SkRandom rand;
for (int i = 0; i < N; i++) {
SkPath p;
rnd_quad(&p, &paint, rand);
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | gm/circles.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698