must call rand in reliable order for bots
authorreed <reed@google.com>
Fri, 19 Aug 2016 02:35:52 +0000 (19:35 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 19 Aug 2016 02:35:52 +0000 (19:35 -0700)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254403002

TBR=

Review-Url: https://codereview.chromium.org/2254403002

gm/simplerect.cpp

index f6c144e..36434f8 100644 (file)
@@ -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);
         }
     }