aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
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 /tests
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 'tests')
-rw-r--r--tests/AAClipTest.cpp10
-rw-r--r--tests/BitmapGetColorTest.cpp6
-rw-r--r--tests/ClampRangeTest.cpp2
-rw-r--r--tests/ClipStackTest.cpp2
-rw-r--r--tests/ColorFilterTest.cpp2
-rw-r--r--tests/ColorTest.cpp4
-rw-r--r--tests/DrawBitmapRectTest.cpp6
-rw-r--r--tests/GLProgramsTest.cpp4
-rw-r--r--tests/GrMemoryPoolTest.cpp6
-rw-r--r--tests/InfRectTest.cpp2
-rw-r--r--tests/LListTest.cpp2
-rw-r--r--tests/MathTest.cpp12
-rw-r--r--tests/MatrixTest.cpp6
-rw-r--r--tests/MipMapTest.cpp4
-rw-r--r--tests/PackBitsTest.cpp2
-rw-r--r--tests/PaintTest.cpp2
-rw-r--r--tests/PathTest.cpp8
-rw-r--r--tests/PathUtilsTest.cpp2
-rw-r--r--tests/PictureTest.cpp10
-rw-r--r--tests/RTreeTest.cpp8
-rw-r--r--tests/RandomTest.cpp8
-rw-r--r--tests/RegionTest.cpp10
-rw-r--r--tests/Sk64Test.cpp2
-rw-r--r--tests/SortTest.cpp4
-rw-r--r--tests/UtilsTest.cpp2
-rw-r--r--tests/Writer32Test.cpp2
26 files changed, 64 insertions, 64 deletions
diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp
index b50757038a..e3be006e57 100644
--- a/tests/AAClipTest.cpp
+++ b/tests/AAClipTest.cpp
@@ -87,7 +87,7 @@ static void copyToMask(const SkRegion& rgn, SkMask* mask) {
canvas.drawColor(SK_ColorBLACK);
}
-static SkIRect rand_rect(SkMWCRandom& rand, int n) {
+static SkIRect rand_rect(SkRandom& rand, int n) {
int x = rand.nextS() % n;
int y = rand.nextS() % n;
int w = rand.nextU() % n;
@@ -95,7 +95,7 @@ static SkIRect rand_rect(SkMWCRandom& rand, int n) {
return SkIRect::MakeXYWH(x, y, w, h);
}
-static void make_rand_rgn(SkRegion* rgn, SkMWCRandom& rand) {
+static void make_rand_rgn(SkRegion* rgn, SkRandom& rand) {
int count = rand.nextU() % 20;
for (int i = 0; i < count; ++i) {
rgn->op(rand_rect(rand, 100), SkRegion::kXOR_Op);
@@ -128,7 +128,7 @@ static void setRgnToPath(SkRegion* rgn, const SkPath& path) {
// aaclip.setRegion should create idential masks to the region
static void test_rgn(skiatest::Reporter* reporter) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 1000; i++) {
SkRegion rgn;
make_rand_rgn(&rgn, rand);
@@ -232,7 +232,7 @@ static void test_empty(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, mask.fBounds.isEmpty());
}
-static void rand_irect(SkIRect* r, int N, SkMWCRandom& rand) {
+static void rand_irect(SkIRect* r, int N, SkRandom& rand) {
r->setXYWH(0, 0, rand.nextU() % N, rand.nextU() % N);
int dx = rand.nextU() % (2*N);
int dy = rand.nextU() % (2*N);
@@ -241,7 +241,7 @@ static void rand_irect(SkIRect* r, int N, SkMWCRandom& rand) {
}
static void test_irect(skiatest::Reporter* reporter) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 10000; i++) {
SkAAClip clip0, clip1;
diff --git a/tests/BitmapGetColorTest.cpp b/tests/BitmapGetColorTest.cpp
index 06e3760245..11c22e6fa3 100644
--- a/tests/BitmapGetColorTest.cpp
+++ b/tests/BitmapGetColorTest.cpp
@@ -10,11 +10,11 @@
#include "SkRect.h"
#include "SkRandom.h"
-static int nextRand(SkMWCRandom& rand, int min, int max) {
+static int nextRand(SkRandom& rand, int min, int max) {
return min + (int)rand.nextRangeU(0, max - min);
}
-static void rand_irect(SkIRect* rect, int W, int H, SkMWCRandom& rand) {
+static void rand_irect(SkIRect* rect, int W, int H, SkRandom& rand) {
const int DX = W / 2;
const int DY = H / 2;
@@ -57,7 +57,7 @@ static void test_eraserect_A1(skiatest::Reporter* reporter) {
bm8.setConfig(SkBitmap::kA8_Config, W, H);
bm8.allocPixels();
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 10000; ++i) {
SkIRect area;
rand_irect(&area, W, H, rand);
diff --git a/tests/ClampRangeTest.cpp b/tests/ClampRangeTest.cpp
index 2462725a08..1d6bcd21ff 100644
--- a/tests/ClampRangeTest.cpp
+++ b/tests/ClampRangeTest.cpp
@@ -107,7 +107,7 @@ void TestClampRange(skiatest::Reporter* reporter) {
test_range(ff(1)/2, ff(16384), 100);
test_range(ff(1)/2, ff(-16384), 100);
- SkMWCRandom rand;
+ SkRandom rand;
// test non-overflow cases
for (int i = 0; i < 1000000; i++) {
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index cbed19364f..c16220e500 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -921,7 +921,7 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
add_oval,
};
- SkMWCRandom r;
+ SkRandom r;
for (int i = 0; i < kNumTests; ++i) {
// Randomly generate a clip stack.
diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp
index 02256493fa..4016f2193d 100644
--- a/tests/ColorFilterTest.cpp
+++ b/tests/ColorFilterTest.cpp
@@ -35,7 +35,7 @@ template <typename T> T* reincarnate(T* obj) {
#define ILLEGAL_MODE ((SkXfermode::Mode)-1)
static void test_asColorMode(skiatest::Reporter* reporter) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int mode = 0; mode <= SkXfermode::kLastMode; mode++) {
SkColor color = rand.nextU();
diff --git a/tests/ColorTest.cpp b/tests/ColorTest.cpp
index c6e5485080..a720ff4eac 100644
--- a/tests/ColorTest.cpp
+++ b/tests/ColorTest.cpp
@@ -146,7 +146,7 @@ static inline void test_premul(skiatest::Reporter* reporter) {
*/
/*
static void test_interp(skiatest::Reporter* reporter) {
- SkMWCRandom r;
+ SkRandom r;
U8CPU a0 = 0;
U8CPU a255 = 255;
@@ -163,7 +163,7 @@ static void test_interp(skiatest::Reporter* reporter) {
*/
static inline void test_fast_interp(skiatest::Reporter* reporter) {
- SkMWCRandom r;
+ SkRandom r;
U8CPU a0 = 0;
U8CPU a255 = 255;
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
index 0538a12aad..bdfa755781 100644
--- a/tests/DrawBitmapRectTest.cpp
+++ b/tests/DrawBitmapRectTest.cpp
@@ -12,7 +12,7 @@
#include "SkRandom.h"
#include "SkMatrixUtils.h"
-static void rand_matrix(SkMatrix* mat, SkMWCRandom& rand, unsigned mask) {
+static void rand_matrix(SkMatrix* mat, SkRandom& rand, unsigned mask) {
mat->setIdentity();
if (mask & SkMatrix::kTranslate_Mask) {
mat->postTranslate(rand.nextSScalar1(), rand.nextSScalar1());
@@ -29,7 +29,7 @@ static void rand_matrix(SkMatrix* mat, SkMWCRandom& rand, unsigned mask) {
}
}
-static void rand_size(SkISize* size, SkMWCRandom& rand) {
+static void rand_size(SkISize* size, SkRandom& rand) {
size->set(rand.nextU() & 0xFFFF, rand.nextU() & 0xFFFF);
}
@@ -43,7 +43,7 @@ static void test_treatAsSprite(skiatest::Reporter* reporter) {
SkMatrix mat;
SkISize size;
- SkMWCRandom rand;
+ SkRandom rand;
// assert: translate-only no-filter can always be treated as sprite
for (int i = 0; i < 1000; ++i) {
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 316465840e..10380f7924 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -22,7 +22,7 @@
#include "SkRandom.h"
#include "Test.h"
-void GrGLProgramDesc::setRandom(SkMWCRandom* random,
+void GrGLProgramDesc::setRandom(SkRandom* random,
const GrGpuGL* gpu,
const GrRenderTarget* dstRenderTarget,
const GrTexture* dstCopyTexture,
@@ -132,7 +132,7 @@ bool GrGpuGL::programUnitTest(int maxStages) {
static const int NUM_TESTS = 512;
- SkMWCRandom random;
+ SkRandom random;
for (int t = 0; t < NUM_TESTS; ++t) {
#if 0
diff --git a/tests/GrMemoryPoolTest.cpp b/tests/GrMemoryPoolTest.cpp
index 0ed77bf5b1..f7866ad5cb 100644
--- a/tests/GrMemoryPoolTest.cpp
+++ b/tests/GrMemoryPoolTest.cpp
@@ -47,7 +47,7 @@ public:
SK_DECLARE_INST_COUNT_ROOT(A);
- static A* Create(SkMWCRandom* r);
+ static A* Create(SkRandom* r);
static void SetAllocator(size_t preallocSize, size_t minAllocSize) {
#if SK_ENABLE_INST_COUNT
@@ -160,7 +160,7 @@ private:
typedef A INHERITED;
};
-A* A::Create(SkMWCRandom* r) {
+A* A::Create(SkRandom* r) {
switch (r->nextRangeU(0, 4)) {
case 0:
return new A;
@@ -201,7 +201,7 @@ static void test_memory_pool(skiatest::Reporter* reporter) {
// number of iterations
static const int kCheckPeriod = 500;
- SkMWCRandom r;
+ SkRandom r;
for (size_t s = 0; s < SK_ARRAY_COUNT(gSizes); ++s) {
A::SetAllocator(gSizes[s][0], gSizes[s][1]);
for (size_t c = 0; c < SK_ARRAY_COUNT(gCreateFraction); ++c) {
diff --git a/tests/InfRectTest.cpp b/tests/InfRectTest.cpp
index 95ef4be3ef..4d957dcf75 100644
--- a/tests/InfRectTest.cpp
+++ b/tests/InfRectTest.cpp
@@ -35,7 +35,7 @@ static void test_center(skiatest::Reporter* reporter) {
gData[index].fRect.centerY() == gData[index].fCenter.y());
}
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 10000; ++i) {
SkIRect r;
diff --git a/tests/LListTest.cpp b/tests/LListTest.cpp
index 88fe11dd39..6b373e33ac 100644
--- a/tests/LListTest.cpp
+++ b/tests/LListTest.cpp
@@ -124,7 +124,7 @@ static void TestTInternalLList(skiatest::Reporter* reporter) {
static void TestTLList(skiatest::Reporter* reporter) {
typedef SkTLList<ListElement> ElList;
typedef ElList::Iter Iter;
- SkMWCRandom random;
+ SkRandom random;
for (int i = 1; i <= 16; i *= 2) {
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index 5ec91a9e5b..cb4d0b8bd2 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -19,7 +19,7 @@ static void test_clz(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, 1 == SkCLZ(1 << 30));
REPORTER_ASSERT(reporter, 0 == SkCLZ(~0U));
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 1000; ++i) {
uint32_t mask = rand.nextU();
// need to get some zeros for testing, but in some obscure way so the
@@ -82,7 +82,7 @@ static void test_muldivround(skiatest::Reporter* reporter) {
}
#endif
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 10000; ++i) {
unsigned a = rand.nextU() & 0x7FFF;
unsigned b = rand.nextU() & 0x7FFF;
@@ -219,7 +219,7 @@ static void check_length(skiatest::Reporter* reporter,
REPORTER_ASSERT(reporter, len > 0.999f && len < 1.001f);
}
-static float nextFloat(SkMWCRandom& rand) {
+static float nextFloat(SkRandom& rand) {
SkFloatIntUnion data;
data.fSignBitInt = rand.nextU();
return data.fFloat;
@@ -293,7 +293,7 @@ static void test_int2float(skiatest::Reporter* reporter, int ival) {
}
static void unittest_fastfloat(skiatest::Reporter* reporter) {
- SkMWCRandom rand;
+ SkRandom rand;
size_t i;
static const float gFloats[] = {
@@ -414,7 +414,7 @@ static void test_copysign(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, sk_float_copysign(x, y) == expected);
}
- SkMWCRandom rand;
+ SkRandom rand;
for (int j = 0; j < 1000; j++) {
int ix = rand.nextS();
REPORTER_ASSERT(reporter, SkCopySign32(ix, ix) == ix);
@@ -433,7 +433,7 @@ static void test_copysign(skiatest::Reporter* reporter) {
static void TestMath(skiatest::Reporter* reporter) {
int i;
int32_t x;
- SkMWCRandom rand;
+ SkRandom rand;
// these should assert
#if 0
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index 0f4973f94d..d75de758f8 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -169,7 +169,7 @@ static void test_matrix_max_stretch(skiatest::Reporter* reporter) {
bool invertable = mats[i].invert(&mats[i + SK_ARRAY_COUNT(baseMats)]);
REPORTER_ASSERT(reporter, invertable);
}
- SkMWCRandom rand;
+ SkRandom rand;
for (int m = 0; m < 1000; ++m) {
SkMatrix mat;
mat.reset();
@@ -492,7 +492,7 @@ static void test_matrix_decomposition(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, check_matrix_recomposition(mat, rotation1, scale, rotation2));
// try some random matrices
- SkMWCRandom rand;
+ SkRandom rand;
for (int m = 0; m < 1000; ++m) {
SkScalar rot0 = rand.nextRangeF(-180, 180);
SkScalar sx = rand.nextRangeF(-3000.f, 3000.f);
@@ -574,7 +574,7 @@ static void test_matrix_homogeneous(skiatest::Reporter* reporter) {
const int kTripleCount = 1000;
const int kMatrixCount = 1000;
- SkMWCRandom rand;
+ SkRandom rand;
SkScalar randTriples[3*kTripleCount];
for (int i = 0; i < 3*kTripleCount; ++i) {
diff --git a/tests/MipMapTest.cpp b/tests/MipMapTest.cpp
index 5862d086c7..398827367a 100644
--- a/tests/MipMapTest.cpp
+++ b/tests/MipMapTest.cpp
@@ -10,7 +10,7 @@
#include "SkBitmap.h"
#include "SkRandom.h"
-static void make_bitmap(SkBitmap* bm, SkMWCRandom& rand) {
+static void make_bitmap(SkBitmap* bm, SkRandom& rand) {
// for now, Build needs a min size of 2, otherwise it will return NULL.
// should fix that to support 1 X N, where N > 1 to return non-null.
int w = 2 + rand.nextU() % 1000;
@@ -22,7 +22,7 @@ static void make_bitmap(SkBitmap* bm, SkMWCRandom& rand) {
static void TestMipMap(skiatest::Reporter* reporter) {
SkBitmap bm;
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 500; ++i) {
make_bitmap(&bm, rand);
diff --git a/tests/PackBitsTest.cpp b/tests/PackBitsTest.cpp
index 59c8a8cab9..f7d4b8e6b1 100644
--- a/tests/PackBitsTest.cpp
+++ b/tests/PackBitsTest.cpp
@@ -14,7 +14,7 @@ static const uint16_t gTest2[] = { 0, 0, 0, 1, 2, 3, 3, 3 };
static const uint16_t gTest3[] = { 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 0, 0, 1 };
#include "SkRandom.h"
-static SkMWCRandom gRand;
+static SkRandom gRand;
static void rand_fill(uint16_t buffer[], int count) {
for (int i = 0; i < count; i++)
buffer[i] = (uint16_t)gRand.nextU();
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp
index c8d2becba2..045c2d22e4 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -71,7 +71,7 @@ static void test_cmap(skiatest::Reporter* reporter) {
{ uni_to_utf32, SkPaint::kUTF32_TextEncoding },
};
- SkMWCRandom rand;
+ SkRandom rand;
SkPaint paint;
paint.setTypeface(SkTypeface::RefDefault())->unref();
SkTypeface* face = paint.getTypeface();
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index ed80d41aa2..080ce285e0 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -426,7 +426,7 @@ static void make_arb_round_rect(SkPath* path, const SkRect& r,
// Note: PathBench::ArbRoundRectBench performs almost exactly
// the same test (but with drawing)
static void test_arb_round_rect_is_convex(skiatest::Reporter* reporter) {
- SkMWCRandom rand;
+ SkRandom rand;
SkRect r;
for (int i = 0; i < 5000; ++i) {
@@ -453,7 +453,7 @@ static void test_arb_round_rect_is_convex(skiatest::Reporter* reporter) {
// Note: PathBench::ArbRoundRectBench performs almost exactly
// the same test (but with drawing)
static void test_arb_zero_rad_round_rect_is_rect(skiatest::Reporter* reporter) {
- SkMWCRandom rand;
+ SkRandom rand;
SkRect r;
for (int i = 0; i < 5000; ++i) {
@@ -592,7 +592,7 @@ DONE:
static void test_addPoly(skiatest::Reporter* reporter) {
SkPoint pts[32];
- SkMWCRandom rand;
+ SkRandom rand;
for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
pts[i].fX = rand.nextSScalar1();
@@ -2035,7 +2035,7 @@ static void test_raw_iter(skiatest::Reporter* reporter) {
}
// Max of 10 segments, max 3 points per segment
- SkMWCRandom rand(9876543);
+ SkRandom rand(9876543);
SkPoint expectedPts[31]; // May have leading moveTo
SkPath::Verb expectedVerbs[22]; // May have leading moveTo
SkPath::Verb nextVerb;
diff --git a/tests/PathUtilsTest.cpp b/tests/PathUtilsTest.cpp
index 15f981bb90..fad5cae0bb 100644
--- a/tests/PathUtilsTest.cpp
+++ b/tests/PathUtilsTest.cpp
@@ -17,7 +17,7 @@
const int kNumIt = 100;
static void fill_random_bits(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/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 349560b21c..a42112de8d 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -75,7 +75,7 @@ static SkPicture* record_bitmaps(const SkBitmap bm[], const SkPoint pos[],
return pic;
}
-static void rand_rect(SkRect* rect, SkMWCRandom& rand, SkScalar W, SkScalar H) {
+static void rand_rect(SkRect* rect, SkRandom& rand, SkScalar W, SkScalar H) {
rect->fLeft = rand.nextRangeScalar(-W, 2*W);
rect->fTop = rand.nextRangeScalar(-H, 2*H);
rect->fRight = rect->fLeft + rand.nextRangeScalar(0, W);
@@ -178,7 +178,7 @@ static void test_gatherpixelrefs(skiatest::Reporter* reporter) {
drawbitmap_proc, drawbitmaprect_proc, drawshader_proc
};
- SkMWCRandom rand;
+ SkRandom rand;
for (size_t k = 0; k < SK_ARRAY_COUNT(procs); ++k) {
SkAutoTUnref<SkPicture> pic(record_bitmaps(bm, pos, N, procs[k]));
@@ -263,7 +263,7 @@ static void test_serializing_empty_picture() {
}
#endif
-static void rand_op(SkCanvas* canvas, SkMWCRandom& rand) {
+static void rand_op(SkCanvas* canvas, SkRandom& rand) {
SkPaint paint;
SkRect rect = SkRect::MakeWH(50, 50);
@@ -284,10 +284,10 @@ static void rand_op(SkCanvas* canvas, SkMWCRandom& rand) {
}
static void test_peephole() {
- SkMWCRandom rand;
+ SkRandom rand;
for (int j = 0; j < 100; j++) {
- SkMWCRandom rand2(rand); // remember the seed
+ SkRandom rand2(rand); // remember the seed
SkPicture picture;
SkCanvas* canvas = picture.beginRecording(100, 100);
diff --git a/tests/RTreeTest.cpp b/tests/RTreeTest.cpp
index 666750b531..a907d6d588 100644
--- a/tests/RTreeTest.cpp
+++ b/tests/RTreeTest.cpp
@@ -23,7 +23,7 @@ struct DataRect {
void* data;
};
-static SkIRect random_rect(SkMWCRandom& rand) {
+static SkIRect random_rect(SkRandom& rand) {
SkIRect rect = {0,0,0,0};
while (rect.isEmpty()) {
rect.fLeft = rand.nextS() % 1000;
@@ -35,7 +35,7 @@ static SkIRect random_rect(SkMWCRandom& rand) {
return rect;
}
-static void random_data_rects(SkMWCRandom& rand, DataRect out[], int n) {
+static void random_data_rects(SkRandom& rand, DataRect out[], int n) {
for (int i = 0; i < n; ++i) {
out[i].rect = random_rect(rand);
out[i].data = reinterpret_cast<void*>(i);
@@ -68,7 +68,7 @@ static bool verify_query(SkIRect query, DataRect rects[],
return found == expected;
}
-static void run_queries(skiatest::Reporter* reporter, SkMWCRandom& rand, DataRect rects[],
+static void run_queries(skiatest::Reporter* reporter, SkRandom& rand, DataRect rects[],
SkRTree& tree) {
for (size_t i = 0; i < NUM_QUERIES; ++i) {
SkTDArray<void*> hits;
@@ -80,7 +80,7 @@ static void run_queries(skiatest::Reporter* reporter, SkMWCRandom& rand, DataRec
static void rtree_test_main(SkRTree* rtree, skiatest::Reporter* reporter) {
DataRect rects[NUM_RECTS];
- SkMWCRandom rand;
+ SkRandom rand;
REPORTER_ASSERT(reporter, NULL != rtree);
int expectedDepthMin = -1;
diff --git a/tests/RandomTest.cpp b/tests/RandomTest.cpp
index 51408e9605..c9fee4aa23 100644
--- a/tests/RandomTest.cpp
+++ b/tests/RandomTest.cpp
@@ -61,7 +61,7 @@ static void test_random_byte(skiatest::Reporter* reporter, int shift) {
int bins[256];
memset(bins, 0, sizeof(int)*256);
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 256*10000; ++i) {
bins[(rand.nextU() >> shift) & 0xff]++;
}
@@ -73,7 +73,7 @@ static void test_random_float(skiatest::Reporter* reporter) {
int bins[256];
memset(bins, 0, sizeof(int)*256);
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 256*10000; ++i) {
float f = rand.nextF();
REPORTER_ASSERT(reporter, 0.0f <= f && f < 1.0f);
@@ -108,7 +108,7 @@ static double test_single_gorilla(skiatest::Reporter* reporter, int shift) {
const int kNumEntries = kN >> 5; // dividing by 32
unsigned int entries[kNumEntries];
- SkMWCRandom rand;
+ SkRandom rand;
memset(entries, 0, sizeof(unsigned int)*kNumEntries);
// pre-seed our string value
int value = 0;
@@ -161,7 +161,7 @@ static void test_gorilla(skiatest::Reporter* reporter) {
}
static void test_range(skiatest::Reporter* reporter) {
- SkMWCRandom rand;
+ SkRandom rand;
// just to make sure we don't crash in this case
(void) rand.nextRangeU(0, 0xffffffff);
diff --git a/tests/RegionTest.cpp b/tests/RegionTest.cpp
index 1c06d7ecde..5d3946ebfe 100644
--- a/tests/RegionTest.cpp
+++ b/tests/RegionTest.cpp
@@ -98,7 +98,7 @@ enum {
H = 256
};
-static SkIRect randRect(SkMWCRandom& rand) {
+static SkIRect randRect(SkRandom& rand) {
int x = rand.nextU() % W;
int y = rand.nextU() % H;
int w = rand.nextU() % W;
@@ -106,7 +106,7 @@ static SkIRect randRect(SkMWCRandom& rand) {
return SkIRect::MakeXYWH(x, y, w >> 1, h >> 1);
}
-static void randRgn(SkMWCRandom& rand, SkRegion* rgn, int n) {
+static void randRgn(SkRandom& rand, SkRegion* rgn, int n) {
rgn->setEmpty();
for (int i = 0; i < n; ++i) {
rgn->op(randRect(rand), SkRegion::kUnion_Op);
@@ -183,7 +183,7 @@ static void intersects_proc(skiatest::Reporter* reporter,
static void test_proc(skiatest::Reporter* reporter,
void (*proc)(skiatest::Reporter*,
const SkRegion& a, const SkRegion&)) {
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 10000; ++i) {
SkRegion outer;
randRgn(rand, &outer, 8);
@@ -193,7 +193,7 @@ static void test_proc(skiatest::Reporter* reporter,
}
}
-static void rand_rect(SkIRect* rect, SkMWCRandom& rand) {
+static void rand_rect(SkIRect* rect, SkRandom& rand) {
int bits = 6;
int shift = 32 - bits;
rect->set(rand.nextU() >> shift, rand.nextU() >> shift,
@@ -237,7 +237,7 @@ static void TestRegion(skiatest::Reporter* reporter) {
};
REPORTER_ASSERT(reporter, test_rects(rects, SK_ARRAY_COUNT(rects)));
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 1000; i++) {
SkRegion rgn0, rgn1;
diff --git a/tests/Sk64Test.cpp b/tests/Sk64Test.cpp
index e956cbbd51..50b7ec7d2f 100644
--- a/tests/Sk64Test.cpp
+++ b/tests/Sk64Test.cpp
@@ -75,7 +75,7 @@ static void TestSk64(skiatest::Reporter* reporter) {
// Now test add/sub
- SkMWCRandom rand;
+ SkRandom rand;
int i;
for (i = 0; i < 1000; i++)
diff --git a/tests/SortTest.cpp b/tests/SortTest.cpp
index 6bfb300a72..28c6e682de 100644
--- a/tests/SortTest.cpp
+++ b/tests/SortTest.cpp
@@ -15,7 +15,7 @@ extern "C" {
}
}
-static void rand_array(SkMWCRandom& rand, int array[], int n) {
+static void rand_array(SkRandom& rand, int array[], int n) {
for (int j = 0; j < n; j++) {
array[j] = rand.nextS() & 0xFF;
}
@@ -40,7 +40,7 @@ static void TestSort(skiatest::Reporter* reporter) {
/** The random numbers are copied into this array, sorted by an SkSort,
then this array is compared against the reference sort. */
int workingArray[SK_ARRAY_COUNT(randomArray)];
- SkMWCRandom rand;
+ SkRandom rand;
for (int i = 0; i < 10000; i++) {
int count = rand.nextRangeU(1, SK_ARRAY_COUNT(randomArray));
diff --git a/tests/UtilsTest.cpp b/tests/UtilsTest.cpp
index 33d5c97112..cb0668ed09 100644
--- a/tests/UtilsTest.cpp
+++ b/tests/UtilsTest.cpp
@@ -123,7 +123,7 @@ static void test_autostarray(skiatest::Reporter* reporter) {
static void test_search(skiatest::Reporter* reporter) {
int i, array[kSEARCH_COUNT];
- SkMWCRandom rand;
+ SkRandom rand;
for (i = 0; i < kSEARCH_COUNT; i++) {
array[i] = rand.nextS();
diff --git a/tests/Writer32Test.cpp b/tests/Writer32Test.cpp
index fd232fc4d0..8b4aba5ec3 100644
--- a/tests/Writer32Test.cpp
+++ b/tests/Writer32Test.cpp
@@ -153,7 +153,7 @@ static void testWritePad(skiatest::Reporter* reporter, SkWriter32* writer) {
SkAutoMalloc originalData(dataSize);
{
- SkMWCRandom rand(0);
+ SkRandom rand(0);
uint32_t* ptr = static_cast<uint32_t*>(originalData.get());
uint32_t* stop = ptr + (dataSize>>2);
while (ptr < stop) {