aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-09 20:09:12 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-09 20:09:12 +0000
commite0e7cfe44bb9d66d76120a79e5275c294bacaa22 (patch)
treed3d282beb8e498659f87abafa5a651946eea6ee8 /bench
parent50b2e33dc6acaed906bfdc89af9b359ea2665c52 (diff)
Change old PRG to be SkLCGRandom; change new one to SkRandom
The goal here is to get people to start using the new random number generator, while leaving the old one in place so we don't have to rebaseline GMs. R=reed@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/23576015 git-svn-id: http://skia.googlecode.com/svn/trunk@11169 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench')
-rw-r--r--bench/AAClipBench.cpp2
-rw-r--r--bench/BicubicBench.cpp2
-rw-r--r--bench/BitmapBench.cpp2
-rw-r--r--bench/BitmapRectBench.cpp2
-rw-r--r--bench/BlurBench.cpp2
-rw-r--r--bench/ChartBench.cpp4
-rw-r--r--bench/ChecksumBench.cpp2
-rw-r--r--bench/FSRectBench.cpp2
-rw-r--r--bench/GameBench.cpp8
-rw-r--r--bench/GrMemoryPoolBench.cpp6
-rw-r--r--bench/HairlinePathBench.cpp10
-rw-r--r--bench/LineBench.cpp2
-rw-r--r--bench/MathBench.cpp14
-rw-r--r--bench/MatrixBench.cpp10
-rw-r--r--bench/MatrixConvolutionBench.cpp2
-rw-r--r--bench/MorphologyBench.cpp2
-rw-r--r--bench/PathBench.cpp16
-rw-r--r--bench/PathIterBench.cpp4
-rw-r--r--bench/PathUtilsBench.cpp2
-rw-r--r--bench/PictureRecordBench.cpp4
-rw-r--r--bench/RTreeBench.cpp24
-rw-r--r--bench/RectBench.cpp4
-rw-r--r--bench/RectoriBench.cpp2
-rw-r--r--bench/RegionBench.cpp4
-rw-r--r--bench/RegionContainBench.cpp4
-rw-r--r--bench/ScalarBench.cpp6
-rw-r--r--bench/ShaderMaskBench.cpp2
-rw-r--r--bench/SortBench.cpp4
-rw-r--r--bench/TextBench.cpp2
-rw-r--r--bench/VertBench.cpp2
-rw-r--r--bench/XfermodeBench.cpp2
31 files changed, 77 insertions, 77 deletions
diff --git a/bench/AAClipBench.cpp b/bench/AAClipBench.cpp
index ef5ba1588e..276a8ff3e7 100644
--- a/bench/AAClipBench.cpp
+++ b/bench/AAClipBench.cpp
@@ -94,7 +94,7 @@ class NestedAAClipBench : public SkBenchmark {
SkString fName;
bool fDoAA;
SkRect fDrawRect;
- SkMWCRandom fRandom;
+ SkRandom fRandom;
static const int kNumDraws = SkBENCHLOOP(2);
static const int kNestingDepth = 3;
diff --git a/bench/BicubicBench.cpp b/bench/BicubicBench.cpp
index 1aa2dbd283..a3a23180f9 100644
--- a/bench/BicubicBench.cpp
+++ b/bench/BicubicBench.cpp
@@ -37,7 +37,7 @@ protected:
paint.setAntiAlias(true);
- SkMWCRandom rand;
+ SkRandom rand;
SkRect r = SkRect::MakeWH(40, 40);
SkAutoTUnref<SkImageFilter> bicubic(SkBicubicImageFilter::CreateMitchell(fScale));
paint.setImageFilter(bicubic);
diff --git a/bench/BitmapBench.cpp b/bench/BitmapBench.cpp
index 9291342565..a472d2489f 100644
--- a/bench/BitmapBench.cpp
+++ b/bench/BitmapBench.cpp
@@ -137,7 +137,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
SkIPoint dim = this->getSize();
- SkMWCRandom rand;
+ SkRandom rand;
SkPaint paint(fPaint);
this->setupPaint(&paint);
diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp
index aee0eec79d..c147da2349 100644
--- a/bench/BitmapRectBench.cpp
+++ b/bench/BitmapRectBench.cpp
@@ -86,7 +86,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkMWCRandom rand;
+ SkRandom rand;
SkPaint paint;
this->setupPaint(&paint);
diff --git a/bench/BlurBench.cpp b/bench/BlurBench.cpp
index 54e7dfdb02..b373df8fa9 100644
--- a/bench/BlurBench.cpp
+++ b/bench/BlurBench.cpp
@@ -59,7 +59,7 @@ protected:
paint.setAntiAlias(true);
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < SkBENCHLOOP(10); i++) {
SkRect r = SkRect::MakeWH(rand.nextUScalar1() * 400,
rand.nextUScalar1() * 400);
diff --git a/bench/ChartBench.cpp b/bench/ChartBench.cpp
index 0a692cfc80..1ecf30ab84 100644
--- a/bench/ChartBench.cpp
+++ b/bench/ChartBench.cpp
@@ -21,7 +21,7 @@ namespace {
// Generates y values for the chart plots.
void gen_data(SkScalar yAvg, SkScalar ySpread, int count, SkTDArray<SkScalar>* dataPts) {
dataPts->setCount(count);
- static SkMWCRandom gRandom;
+ static SkRandom gRandom;
for (int i = 0; i < count; ++i) {
(*dataPts)[i] = gRandom.nextRangeScalar(yAvg - SkScalarHalf(ySpread),
yAvg + SkScalarHalf(ySpread));
@@ -131,7 +131,7 @@ protected:
canvas->clear(0xFFE0F0E0);
- static SkMWCRandom colorRand;
+ static SkRandom colorRand;
static SkColor gColors[kNumGraphs] = { 0x0 };
if (0 == gColors[0]) {
for (int i = 0; i < kNumGraphs; ++i) {
diff --git a/bench/ChecksumBench.cpp b/bench/ChecksumBench.cpp
index bc13ec5a55..315402eeee 100644
--- a/bench/ChecksumBench.cpp
+++ b/bench/ChecksumBench.cpp
@@ -30,7 +30,7 @@ class ComputeChecksumBench : public SkBenchmark {
public:
ComputeChecksumBench(void* param, ChecksumType type) : INHERITED(param), fType(type) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < U32COUNT; ++i) {
fData[i] = rand.nextU();
}
diff --git a/bench/FSRectBench.cpp b/bench/FSRectBench.cpp
index 64c1c3d35f..5ae4c2f1db 100644
--- a/bench/FSRectBench.cpp
+++ b/bench/FSRectBench.cpp
@@ -27,7 +27,7 @@ protected:
virtual void onPreDraw() SK_OVERRIDE {
if (!fInit) {
- SkMWCRandom rand;
+ SkRandom rand;
static const SkScalar kMinOffset = 0;
static const SkScalar kMaxOffset = 100 * SK_Scalar1;
static const SkScalar kOffsetRange = kMaxOffset - kMinOffset;
diff --git a/bench/GameBench.cpp b/bench/GameBench.cpp
index 70514947df..44f92cb8e6 100644
--- a/bench/GameBench.cpp
+++ b/bench/GameBench.cpp
@@ -88,9 +88,9 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkMWCRandom scaleRand;
- SkMWCRandom transRand;
- SkMWCRandom rotRand;
+ SkRandom scaleRand;
+ SkRandom transRand;
+ SkRandom rotRand;
int width, height;
if (fUseAtlas) {
@@ -280,7 +280,7 @@ private:
// Note: the resulting atlas has transparency
void makeAtlas() {
- SkMWCRandom rand;
+ SkRandom rand;
SkColor colors[kNumAtlasedX][kNumAtlasedY];
diff --git a/bench/GrMemoryPoolBench.cpp b/bench/GrMemoryPoolBench.cpp
index 78a283b0c5..dccf8278f5 100644
--- a/bench/GrMemoryPoolBench.cpp
+++ b/bench/GrMemoryPoolBench.cpp
@@ -47,7 +47,7 @@ protected:
}
virtual void onDraw(SkCanvas*) {
- SkMWCRandom r;
+ SkRandom r;
enum {
kMaxObjects = 4 * (1 << 10),
};
@@ -103,7 +103,7 @@ protected:
}
virtual void onDraw(SkCanvas*) {
- SkMWCRandom r;
+ SkRandom r;
enum {
kMaxObjects = 4 * (1 << 10),
};
@@ -141,7 +141,7 @@ protected:
}
virtual void onDraw(SkCanvas*) {
- SkMWCRandom r;
+ SkRandom r;
A* objects[M];
for (int i = 0; i < N; i++) {
uint32_t count = r.nextRangeU(0, M-1);
diff --git a/bench/HairlinePathBench.cpp b/bench/HairlinePathBench.cpp
index ca3797b7b2..f5b30a38ad 100644
--- a/bench/HairlinePathBench.cpp
+++ b/bench/HairlinePathBench.cpp
@@ -85,7 +85,7 @@ public:
name->append("line");
}
virtual void makePath(SkPath* path) SK_OVERRIDE {
- SkMWCRandom rand;
+ SkRandom rand;
int size = SK_ARRAY_COUNT(points);
int hSize = size / 2;
for (int i = 0; i < kMaxPathSize; ++i) {
@@ -117,7 +117,7 @@ public:
name->append("quad");
}
virtual void makePath(SkPath* path) SK_OVERRIDE {
- SkMWCRandom rand;
+ SkRandom rand;
int size = SK_ARRAY_COUNT(points);
int hSize = size / 2;
for (int i = 0; i < kMaxPathSize; ++i) {
@@ -149,8 +149,8 @@ public:
name->append("conic");
}
virtual void makePath(SkPath* path) SK_OVERRIDE {
- SkMWCRandom rand;
- SkMWCRandom randWeight;
+ SkRandom rand;
+ SkRandom randWeight;
int size = SK_ARRAY_COUNT(points);
int hSize = size / 2;
for (int i = 0; i < kMaxPathSize; ++i) {
@@ -184,7 +184,7 @@ public:
name->append("cubic");
}
virtual void makePath(SkPath* path) SK_OVERRIDE {
- SkMWCRandom rand;
+ SkRandom rand;
int size = SK_ARRAY_COUNT(points);
int hSize = size / 2;
for (int i = 0; i < kMaxPathSize; ++i) {
diff --git a/bench/LineBench.cpp b/bench/LineBench.cpp
index 69074359ae..feaae2b267 100644
--- a/bench/LineBench.cpp
+++ b/bench/LineBench.cpp
@@ -32,7 +32,7 @@ public:
fDoAA = doAA;
fName.printf("lines_%g_%s", width, doAA ? "AA" : "BW");
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < PTS; ++i) {
fPts[i].set(rand.nextUScalar1() * 640, rand.nextUScalar1() * 480);
}
diff --git a/bench/MathBench.cpp b/bench/MathBench.cpp
index 5470924836..32a89d64ef 100644
--- a/bench/MathBench.cpp
+++ b/bench/MathBench.cpp
@@ -26,7 +26,7 @@ public:
MathBench(void* param, const char name[]) : INHERITED(param) {
fName.printf("math_%s", name);
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < kBuffer; ++i) {
fSrc[i] = rand.nextSScalar1();
}
@@ -254,7 +254,7 @@ class IsFiniteBench : public SkBenchmark {
public:
IsFiniteBench(void* param, int index) : INHERITED(param) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < N; ++i) {
fData[i] = rand.nextSScalar1();
@@ -322,7 +322,7 @@ class FloorBench : public SkBenchmark {
public:
FloorBench(void* param, bool fast) : INHERITED(param), fFast(fast) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < ARRAY; ++i) {
fData[i] = rand.nextSScalar1();
@@ -340,7 +340,7 @@ public:
protected:
virtual void onDraw(SkCanvas*) {
- SkMWCRandom rand;
+ SkRandom rand;
float accum = 0;
const float* data = fData;
@@ -384,7 +384,7 @@ public:
: INHERITED(param)
, fUsePortable(usePortable) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < ARRAY; ++i) {
fData[i] = rand.nextU();
}
@@ -444,7 +444,7 @@ public:
NormalizeBench(void* param)
: INHERITED(param) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < ARRAY; ++i) {
fVec[i].set(rand.nextSScalar1(), rand.nextSScalar1());
}
@@ -490,7 +490,7 @@ class FixedMathBench : public SkBenchmark {
public:
FixedMathBench(void* param) : INHERITED(param) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < N; ++i) {
fData[i] = rand.nextSScalar1();
}
diff --git a/bench/MatrixBench.cpp b/bench/MatrixBench.cpp
index e7054d43b8..8a5c5c69b4 100644
--- a/bench/MatrixBench.cpp
+++ b/bench/MatrixBench.cpp
@@ -95,7 +95,7 @@ private:
// handling NaN values is a lot slower. Anyway, this guy is just meant to put
// reasonable values in our arrays.
template <typename T> void init9(T array[9]) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 9; i++) {
array[i] = rand.nextSScalar1();
}
@@ -261,7 +261,7 @@ protected:
private:
SkMatrix fMatrix;
float fArray[9];
- SkMWCRandom fRnd;
+ SkRandom fRnd;
typedef MatrixBench INHERITED;
};
@@ -302,7 +302,7 @@ class ScaleTransMixedMatrixBench : public MatrixBench {
SkMatrix fMatrix;
SkPoint fSrc [16];
SkPoint fDst [16];
- SkMWCRandom fRandom;
+ SkRandom fRandom;
typedef MatrixBench INHERITED;
};
@@ -342,7 +342,7 @@ class ScaleTransDoubleMatrixBench : public MatrixBench {
double fMatrix [9];
SkPoint fSrc [16];
SkPoint fDst [16];
- SkMWCRandom fRandom;
+ SkRandom fRandom;
typedef MatrixBench INHERITED;
};
@@ -370,7 +370,7 @@ protected:
}
private:
SkMatrix fMatrix[10];
- SkMWCRandom fRandom;
+ SkRandom fRandom;
typedef MatrixBench INHERITED;
};
diff --git a/bench/MatrixConvolutionBench.cpp b/bench/MatrixConvolutionBench.cpp
index 82ac78cb0e..161fc23296 100644
--- a/bench/MatrixConvolutionBench.cpp
+++ b/bench/MatrixConvolutionBench.cpp
@@ -39,7 +39,7 @@ protected:
SkPaint paint;
this->setupPaint(&paint);
paint.setAntiAlias(true);
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < SkBENCHLOOP(3); i++) {
SkRect r = SkRect::MakeWH(rand.nextUScalar1() * 400,
rand.nextUScalar1() * 400);
diff --git a/bench/MorphologyBench.cpp b/bench/MorphologyBench.cpp
index 961721d77e..f9657bafd2 100644
--- a/bench/MorphologyBench.cpp
+++ b/bench/MorphologyBench.cpp
@@ -59,7 +59,7 @@ protected:
paint.setAntiAlias(true);
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < SkBENCHLOOP(3); i++) {
SkRect r = SkRect::MakeWH(rand.nextUScalar1() * 400,
rand.nextUScalar1() * 400);
diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp
index 967f501acf..057a2b028c 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);
}
diff --git a/bench/PathIterBench.cpp b/bench/PathIterBench.cpp
index e560ff76ef..987a752ad9 100644
--- a/bench/PathIterBench.cpp
+++ b/bench/PathIterBench.cpp
@@ -14,7 +14,7 @@
#include "SkShader.h"
#include "SkString.h"
-static int rand_pts(SkMWCRandom& rand, SkPoint pts[4]) {
+static int rand_pts(SkRandom& rand, SkPoint pts[4]) {
int n = rand.nextU() & 3;
n += 1;
@@ -37,7 +37,7 @@ public:
fName.printf("pathiter_%s", raw ? "raw" : "consume");
fRaw = raw;
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 1000; ++i) {
SkPoint pts[4];
int n = rand_pts(rand, pts);
diff --git a/bench/PathUtilsBench.cpp b/bench/PathUtilsBench.cpp
index a021f22f68..613d49aa41 100644
--- a/bench/PathUtilsBench.cpp
+++ b/bench/PathUtilsBench.cpp
@@ -18,7 +18,7 @@
//this function is redefined for sample, test, and bench. is there anywhere
// I can put it to avoid code duplcation?
static void fillRandomBits( int chars, char* bits ){
- SkMWCRandom rand(SkTime::GetMSecs());
+ SkRandom rand(SkTime::GetMSecs());
for (int i = 0; i < chars; ++i){
bits[i] = rand.nextU();
diff --git a/bench/PictureRecordBench.cpp b/bench/PictureRecordBench.cpp
index 1ba3cb3166..f23f0cb961 100644
--- a/bench/PictureRecordBench.cpp
+++ b/bench/PictureRecordBench.cpp
@@ -143,7 +143,7 @@ public:
protected:
virtual float innerLoopScale() const SK_OVERRIDE { return 0.1f; }
virtual void recordCanvas(SkCanvas* canvas) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < M; i++) {
SkPaint paint;
paint.setColor(rand.nextU());
@@ -167,7 +167,7 @@ class RecurringPaintDictionaryRecordBench : public PictureRecordBench {
public:
RecurringPaintDictionaryRecordBench(void* param)
: INHERITED(param, "recurring_paint_dictionary") {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < ObjCount; i++) {
fPaint[i].setColor(rand.nextU());
}
diff --git a/bench/RTreeBench.cpp b/bench/RTreeBench.cpp
index 606a84d156..7dc54ca329 100644
--- a/bench/RTreeBench.cpp
+++ b/bench/RTreeBench.cpp
@@ -19,7 +19,7 @@ static const int NUM_QUERY_RECTS = 5000;
static const int NUM_QUERIES = 1000;
static const int GRID_WIDTH = 100;
-typedef SkIRect (*MakeRectProc)(SkMWCRandom&, int, int);
+typedef SkIRect (*MakeRectProc)(SkRandom&, int, int);
// Time how long it takes to build an R-Tree either bulk-loaded or not
class BBoxBuildBench : public SkBenchmark {
@@ -46,7 +46,7 @@ protected:
return fName.c_str();
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < SkBENCHLOOP(100); ++i) {
for (int j = 0; j < NUM_BUILD_RECTS; ++j) {
fTree->insert(reinterpret_cast<void*>(j), fProc(rand, j, NUM_BUILD_RECTS),
@@ -97,7 +97,7 @@ protected:
return fName.c_str();
}
virtual void onPreDraw() SK_OVERRIDE {
- SkMWCRandom rand;
+ SkRandom rand;
for (int j = 0; j < SkBENCHLOOP(NUM_QUERY_RECTS); ++j) {
fTree->insert(reinterpret_cast<void*>(j), fProc(rand, j,
SkBENCHLOOP(NUM_QUERY_RECTS)), fBulkLoad);
@@ -106,7 +106,7 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < SkBENCHLOOP(NUM_QUERIES); ++i) {
SkTDArray<void*> hits;
SkIRect query;
@@ -149,22 +149,22 @@ private:
typedef SkBenchmark INHERITED;
};
-static inline SkIRect make_simple_rect(SkMWCRandom&, int index, int numRects) {
+static inline SkIRect make_simple_rect(SkRandom&, int index, int numRects) {
SkIRect out = {0, 0, GENERATE_EXTENTS, GENERATE_EXTENTS};
return out;
}
-static inline SkIRect make_concentric_rects_increasing(SkMWCRandom&, int index, int numRects) {
+static inline SkIRect make_concentric_rects_increasing(SkRandom&, int index, int numRects) {
SkIRect out = {0, 0, index + 1, index + 1};
return out;
}
-static inline SkIRect make_concentric_rects_decreasing(SkMWCRandom&, int index, int numRects) {
+static inline SkIRect make_concentric_rects_decreasing(SkRandom&, int index, int numRects) {
SkIRect out = {0, 0, numRects - index, numRects - index};
return out;
}
-static inline SkIRect make_XYordered_rects(SkMWCRandom& rand, int index, int numRects) {
+static inline SkIRect make_XYordered_rects(SkRandom& rand, int index, int numRects) {
SkIRect out;
out.fLeft = index % GRID_WIDTH;
out.fTop = index / GRID_WIDTH;
@@ -172,7 +172,7 @@ static inline SkIRect make_XYordered_rects(SkMWCRandom& rand, int index, int num
out.fBottom = out.fTop + 1 + rand.nextU() % (GENERATE_EXTENTS / 3);
return out;
}
-static inline SkIRect make_YXordered_rects(SkMWCRandom& rand, int index, int numRects) {
+static inline SkIRect make_YXordered_rects(SkRandom& rand, int index, int numRects) {
SkIRect out;
out.fLeft = index / GRID_WIDTH;
out.fTop = index % GRID_WIDTH;
@@ -181,7 +181,7 @@ static inline SkIRect make_YXordered_rects(SkMWCRandom& rand, int index, int num
return out;
}
-static inline SkIRect make_point_rects(SkMWCRandom& rand, int index, int numRects) {
+static inline SkIRect make_point_rects(SkRandom& rand, int index, int numRects) {
SkIRect out;
out.fLeft = rand.nextU() % GENERATE_EXTENTS;
out.fTop = rand.nextU() % GENERATE_EXTENTS;
@@ -190,7 +190,7 @@ static inline SkIRect make_point_rects(SkMWCRandom& rand, int index, int numRect
return out;
}
-static inline SkIRect make_random_rects(SkMWCRandom& rand, int index, int numRects) {
+static inline SkIRect make_random_rects(SkRandom& rand, int index, int numRects) {
SkIRect out;
out.fLeft = rand.nextS() % GENERATE_EXTENTS;
out.fTop = rand.nextS() % GENERATE_EXTENTS;
@@ -199,7 +199,7 @@ static inline SkIRect make_random_rects(SkMWCRandom& rand, int index, int numRec
return out;
}
-static inline SkIRect make_large_rects(SkMWCRandom& rand, int index, int numRects) {
+static inline SkIRect make_large_rects(SkRandom& rand, int index, int numRects) {
SkIRect out;
out.fLeft = rand.nextU() % GENERATE_EXTENTS;
out.fTop = rand.nextU() % GENERATE_EXTENTS;
diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp
index e3d0e24265..99ff0a94f1 100644
--- a/bench/RectBench.cpp
+++ b/bench/RectBench.cpp
@@ -27,7 +27,7 @@ public:
: INHERITED(param)
, fShift(shift)
, fStroke(stroke) {
- SkMWCRandom rand;
+ SkRandom rand;
const SkScalar offset = SK_Scalar1/3;
for (int i = 0; i < N; i++) {
int x = rand.nextU() % W;
@@ -246,7 +246,7 @@ protected:
gSizes[0] = this->getStrokeWidth();
sizes = 1;
}
- SkMWCRandom rand;
+ SkRandom rand;
SkColor color = 0xFF000000;
U8CPU alpha = 0xFF;
SkPaint paint;
diff --git a/bench/RectoriBench.cpp b/bench/RectoriBench.cpp
index 1aa9814207..bb887971c1 100644
--- a/bench/RectoriBench.cpp
+++ b/bench/RectoriBench.cpp
@@ -25,7 +25,7 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkMWCRandom Random;
+ SkRandom Random;
for (int i = 0; i < N; i++) {
SkScalar blurSigma = Random.nextRangeScalar(1.5f, 25.0f);
diff --git a/bench/RegionBench.cpp b/bench/RegionBench.cpp
index 4c2ea6e124..7a306e97c3 100644
--- a/bench/RegionBench.cpp
+++ b/bench/RegionBench.cpp
@@ -82,7 +82,7 @@ public:
N = SkBENCHLOOP(2000)
};
- SkIRect randrect(SkMWCRandom& rand) {
+ SkIRect randrect(SkRandom& rand) {
int x = rand.nextU() % W;
int y = rand.nextU() % H;
int w = rand.nextU() % W;
@@ -95,7 +95,7 @@ public:
fName.printf("region_%s_%d", name, count);
fLoopMul = mul;
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < count; i++) {
fA.op(randrect(rand), SkRegion::kXOR_Op);
fB.op(randrect(rand), SkRegion::kXOR_Op);
diff --git a/bench/RegionContainBench.cpp b/bench/RegionContainBench.cpp
index 40375da847..8668513979 100644
--- a/bench/RegionContainBench.cpp
+++ b/bench/RegionContainBench.cpp
@@ -29,7 +29,7 @@ public:
N = SkBENCHLOOP(20000)
};
- SkIRect randrect(SkMWCRandom& rand, int i) {
+ SkIRect randrect(SkRandom& rand, int i) {
int w = rand.nextU() % W;
return SkIRect::MakeXYWH(0, i*H/COUNT, w, H/COUNT);
}
@@ -38,7 +38,7 @@ public:
fProc = proc;
fName.printf("region_contains_%s", name);
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < COUNT; i++) {
fA.op(randrect(rand, i), SkRegion::kXOR_Op);
}
diff --git a/bench/ScalarBench.cpp b/bench/ScalarBench.cpp
index 405d51e953..333dd229e1 100644
--- a/bench/ScalarBench.cpp
+++ b/bench/ScalarBench.cpp
@@ -56,7 +56,7 @@ int gScalarBench_NonStaticGlobal;
// handling NaN values is a lot slower. Anyway, this guy is just meant to put
// reasonable values in our arrays.
template <typename T> void init9(T array[9]) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 9; i++) {
array[i] = rand.nextSScalar1();
}
@@ -102,7 +102,7 @@ private:
class IsFiniteScalarBench : public ScalarBench {
public:
IsFiniteScalarBench(void* param) : INHERITED(param, "isfinite") {
- SkMWCRandom rand;
+ SkRandom rand;
for (size_t i = 0; i < ARRAY_N; ++i) {
fArray[i] = rand.nextSScalar1();
}
@@ -141,7 +141,7 @@ class RectBoundsBench : public SkBenchmark {
public:
RectBoundsBench(void* param) : INHERITED(param) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < PTS; ++i) {
fPts[i].fX = rand.nextSScalar1();
fPts[i].fY = rand.nextSScalar1();
diff --git a/bench/ShaderMaskBench.cpp b/bench/ShaderMaskBench.cpp
index d2f4e26c02..0e8e4bbee9 100644
--- a/bench/ShaderMaskBench.cpp
+++ b/bench/ShaderMaskBench.cpp
@@ -59,7 +59,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
const SkIPoint dim = this->getSize();
- SkMWCRandom rand;
+ SkRandom rand;
SkPaint paint(fPaint);
this->setupPaint(&paint);
diff --git a/bench/SortBench.cpp b/bench/SortBench.cpp
index 3e4637780d..c19ebae0c8 100644
--- a/bench/SortBench.cpp
+++ b/bench/SortBench.cpp
@@ -13,14 +13,14 @@
static const int N = 1000;
static void rand_proc(int array[], int count) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < count; ++i) {
array[i] = rand.nextS();
}
}
static void randN_proc(int array[], int count) {
- SkMWCRandom rand;
+ SkRandom rand;
int mod = N / 10;
for (int i = 0; i < count; ++i) {
array[i] = rand.nextU() % mod;
diff --git a/bench/TextBench.cpp b/bench/TextBench.cpp
index 4f78e18a3d..9334c33476 100644
--- a/bench/TextBench.cpp
+++ b/bench/TextBench.cpp
@@ -94,7 +94,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
const SkIPoint dim = this->getSize();
- SkMWCRandom rand;
+ SkRandom rand;
SkPaint paint(fPaint);
this->setupPaint(&paint);
diff --git a/bench/VertBench.cpp b/bench/VertBench.cpp
index 564a3064c7..5456e28825 100644
--- a/bench/VertBench.cpp
+++ b/bench/VertBench.cpp
@@ -68,7 +68,7 @@ public:
SkASSERT(PTS == pts - fPts);
SkASSERT(IDX == idx - fIdx);
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < PTS; ++i) {
fColors[i] = rand.nextU() | (0xFF << 24);
}
diff --git a/bench/XfermodeBench.cpp b/bench/XfermodeBench.cpp
index 71cf0e69b5..0f70a4c053 100644
--- a/bench/XfermodeBench.cpp
+++ b/bench/XfermodeBench.cpp
@@ -35,7 +35,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
SkISize size = canvas->getDeviceSize();
- SkMWCRandom random;
+ SkRandom random;
for (int i = 0; i < kNumRects; ++i) {
SkPaint paint;
paint.setXfermode(fXfermode.get());