diff options
author | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-26 14:40:38 +0000 |
---|---|---|
committer | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-26 14:40:38 +0000 |
commit | 17b78946096265d80215a6c946286ecaa35ea7ed (patch) | |
tree | 3af45529670451a9df0bd13ca71fa6a4a98d0eae /gm/points.cpp | |
parent | 5f226572b3b6e1a6fea11f5f3c862a47158f66fe (diff) |
rolling back the experimental rollbacks in r2178-2179
git-svn-id: http://skia.googlecode.com/svn/trunk@2180 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/points.cpp')
-rw-r--r-- | gm/points.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gm/points.cpp b/gm/points.cpp index ff535cd24d..4aa65975b6 100644 --- a/gm/points.cpp +++ b/gm/points.cpp @@ -28,8 +28,14 @@ protected: } static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) { - for (size_t i = 0; i < n; i++) - pts[i].set(rand->nextUScalar1() * 640, rand->nextUScalar1() * 480); + for (size_t i = 0; i < n; i++) { + // Compute these independently and store in variables, rather + // than in the parameter-passing expression, to get consistent + // evaluation order across compilers. + float y = rand->nextUScalar1() * 480; + float x = rand->nextUScalar1() * 640; + pts[i].set(x, y); + } } virtual void onDraw(SkCanvas* canvas) { |