aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-08-18 19:35:52 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-18 19:35:52 -0700
commitc1fb8e8b5942e506558a1aa6e15c2fdadf68424b (patch)
treecaa2d756891e8e9330a323c62b76d9923aafec90 /gm
parentd4d8b394417e11bf2f3116418e4b0d83c9caf495 (diff)
must call rand in reliable order for bots
Diffstat (limited to 'gm')
-rw-r--r--gm/simplerect.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/gm/simplerect.cpp b/gm/simplerect.cpp
index f6c144e293..36434f826c 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);
}
}