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

Unified Diff: gm/simplerect.cpp

Issue 2254403002: must call rand in reliable order for bots (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/simplerect.cpp
diff --git a/gm/simplerect.cpp b/gm/simplerect.cpp
index f6c144e2939560a58edd235d87cc6c00aa9458e8..36434f826c96e334d1829145073427d6d5d54978 100644
--- a/gm/simplerect.cpp
+++ b/gm/simplerect.cpp
@@ -22,7 +22,7 @@ protected:
}
SkISize onISize() override {
- return SkISize::Make(800, 600);
+ return SkISize::Make(800, 800);
}
void onDraw(SkCanvas* canvas) override {
@@ -34,11 +34,11 @@ protected:
SkPaint paint;
for (int i = 0; i < 10000; i++) {
paint.setColor(sk_tool_utils::color_to_565(rand.nextU() | (0xFF << 24)));
- canvas->drawRect(SkRect::MakeXYWH(rand.nextRangeScalar(min, max),
- rand.nextRangeScalar(min, max),
- rand.nextRangeScalar(0, size),
- rand.nextRangeScalar(0, size)),
- paint);
+ SkScalar x = rand.nextRangeScalar(min, max);
+ SkScalar y = rand.nextRangeScalar(min, max);
+ SkScalar w = rand.nextRangeScalar(0, size);
+ SkScalar h = rand.nextRangeScalar(0, size);
+ canvas->drawRect(SkRect::MakeXYWH(x, y, w, h), paint);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698