diff options
author | 2012-07-10 13:17:45 +0000 | |
---|---|---|
committer | 2012-07-10 13:17:45 +0000 | |
commit | 7fe6409ecbff281edd6251c128eff38a7c206524 (patch) | |
tree | a786951cf17e6f8058502108bb8cb8ebe5f3b2d5 /bench | |
parent | 0a946d9000521bb907196decfd3681d724c4d72f (diff) |
change unique_paint_dictionary to change the paint randomly, instead of just
incrementing a value, to avoid accidental best/worst case behavior on our
insertion sort.
git-svn-id: http://skia.googlecode.com/svn/trunk@4501 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench')
-rw-r--r-- | bench/PictureRecordBench.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bench/PictureRecordBench.cpp b/bench/PictureRecordBench.cpp index 092c532831..0f82fda134 100644 --- a/bench/PictureRecordBench.cpp +++ b/bench/PictureRecordBench.cpp @@ -10,6 +10,7 @@ #include "SkPaint.h" #include "SkPicture.h" #include "SkPoint.h" +#include "SkRandom.h" #include "SkRect.h" #include "SkString.h" @@ -141,10 +142,10 @@ public: protected: virtual float innerLoopScale() const SK_OVERRIDE { return 0.1f; } virtual void recordCanvas(SkCanvas* canvas) { - + SkRandom rand; for (int i = 0; i < M; i++) { SkPaint paint; - paint.setColor(i); + paint.setColor(rand.nextU()); canvas->drawPaint(paint); } } |