Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3031)

Unified Diff: bench/PathBench.cpp

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/MorphologyBench.cpp ('k') | bench/PathIterBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PathBench.cpp
diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp
index 967f501acf03438b8c8cc9c9d2837e5f94c44de1..057a2b028c3666ecc8bf6d1f2021f33162fc346d 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 {
- SkMWCRandom rand (12);
+ SkRandom 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 {
- SkMWCRandom rand;
+ SkRandom 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;
- SkMWCRandom fRandom;
+ SkRandom fRandom;
typedef SkBenchmark INHERITED;
};
@@ -653,7 +653,7 @@ protected:
paint.setStyle(SkPaint::kStroke_Style);
}
- SkMWCRandom rand;
+ SkRandom rand;
SkRect r;
@@ -754,7 +754,7 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkMWCRandom rand;
+ SkRandom rand;
SkRect r;
for (int i = 0; i < 5000; ++i) {
@@ -834,7 +834,7 @@ private:
virtual void onPreDraw() SK_OVERRIDE {
fQueryRects.setCount(kQueryRectCnt);
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < kQueryRectCnt; ++i) {
SkSize size;
SkPoint xy;
@@ -931,7 +931,7 @@ private:
///////////////////////////////////////////////////////////////////////////////
-static void rand_conic(SkConic* conic, SkMWCRandom& rand) {
+static void rand_conic(SkConic* conic, SkRandom& 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, SkMWCRandom& rand) {
class ConicBench : public SkBenchmark {
public:
ConicBench(void* param) : INHERITED(param) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < CONICS; ++i) {
rand_conic(&fConics[i], rand);
}
« no previous file with comments | « bench/MorphologyBench.cpp ('k') | bench/PathIterBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698