aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/PathBench.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-06 19:05:11 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-06 19:05:11 +0000
commit6485b0be74f66587b51ca3c476b24b0e2674ca5b (patch)
tree4898a5943171b6eccfa408d8df04f48bb843f3cb /bench/PathBench.cpp
parent1e627276c55f1627bef3afa0051685d99443ab1f (diff)
Switch out random number generator for tests, benches, samples.
This change makes tests, benches and samples use the new SkMWCRandom PRNG. GMs will be saved for another time, as they'll require rebaselining. R=reed@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/23653018 git-svn-id: http://skia.googlecode.com/svn/trunk@11136 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/PathBench.cpp')
-rw-r--r--bench/PathBench.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp
index 057a2b028c..967f501acf 100644
--- a/bench/PathBench.cpp
+++ b/bench/PathBench.cpp
@@ -183,7 +183,7 @@ public:
name->append("long_curved");
}
virtual void makePath(SkPath* path) SK_OVERRIDE {
- SkRandom rand (12);
+ SkMWCRandom rand (12);
int i;
for (i = 0; i < 100; i++) {
path->quadTo(SkScalarMul(rand.nextUScalar1(), SkIntToScalar(640)),
@@ -208,7 +208,7 @@ public:
name->append("long_line");
}
virtual void makePath(SkPath* path) SK_OVERRIDE {
- SkRandom rand;
+ SkMWCRandom rand;
path->moveTo(rand.nextUScalar1() * 640, rand.nextUScalar1() * 480);
for (size_t i = 1; i < 100; i++) {
path->lineTo(rand.nextUScalar1() * 640, rand.nextUScalar1() * 480);
@@ -316,7 +316,7 @@ private:
int fCurrPath;
int fCurrVerb;
int fCurrPoint;
- SkRandom fRandom;
+ SkMWCRandom fRandom;
typedef SkBenchmark INHERITED;
};
@@ -653,7 +653,7 @@ protected:
paint.setStyle(SkPaint::kStroke_Style);
}
- SkRandom rand;
+ SkMWCRandom rand;
SkRect r;
@@ -754,7 +754,7 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkRandom rand;
+ SkMWCRandom rand;
SkRect r;
for (int i = 0; i < 5000; ++i) {
@@ -834,7 +834,7 @@ private:
virtual void onPreDraw() SK_OVERRIDE {
fQueryRects.setCount(kQueryRectCnt);
- SkRandom rand;
+ SkMWCRandom rand;
for (int i = 0; i < kQueryRectCnt; ++i) {
SkSize size;
SkPoint xy;
@@ -931,7 +931,7 @@ private:
///////////////////////////////////////////////////////////////////////////////
-static void rand_conic(SkConic* conic, SkRandom& rand) {
+static void rand_conic(SkConic* conic, SkMWCRandom& rand) {
for (int i = 0; i < 3; ++i) {
conic->fPts[i].set(rand.nextUScalar1() * 100, rand.nextUScalar1() * 100);
}
@@ -945,7 +945,7 @@ static void rand_conic(SkConic* conic, SkRandom& rand) {
class ConicBench : public SkBenchmark {
public:
ConicBench(void* param) : INHERITED(param) {
- SkRandom rand;
+ SkMWCRandom rand;
for (int i = 0; i < CONICS; ++i) {
rand_conic(&fConics[i], rand);
}