From 3f088e36516ad6bf4fe9c04dfc5a49c0aafef372 Mon Sep 17 00:00:00 2001 From: "tomhudson@google.com" Date: Thu, 25 Aug 2011 19:56:04 +0000 Subject: Move multiple calls to random() out of parameter lists so that the evaluation order is consistent across compilers. git-svn-id: http://skia.googlecode.com/svn/trunk@2173 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/strokerects.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gm/strokerects.cpp') diff --git a/gm/strokerects.cpp b/gm/strokerects.cpp index 29d8cb0ae8..44c012029c 100644 --- a/gm/strokerects.cpp +++ b/gm/strokerects.cpp @@ -38,9 +38,11 @@ protected: SkScalar y = rand.nextUScalar1() * H; SkScalar w = rand.nextUScalar1() * (W >> 2); SkScalar h = rand.nextUScalar1() * (H >> 2); + SkScalar hoffset = rand.nextSScalar1(); + SkScalar woffset = rand.nextSScalar1(); r->set(x, y, x + w, y + h); - r->offset(-w/2 + rand.nextSScalar1(), -h/2 + + rand.nextSScalar1()); + r->offset(-w/2 + woffset, -h/2 + hoffset); } virtual void onDraw(SkCanvas* canvas) { -- cgit v1.2.3