aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/SkFloat.cpp2
-rw-r--r--src/core/SkGraphics.cpp1
-rw-r--r--src/core/SkMatrix.cpp2
-rw-r--r--src/gpu/GrRedBlackTree.h2
-rw-r--r--src/gpu/gl/GrGLEffectMatrix.h1
-rw-r--r--tests/AAClipTest.cpp10
-rw-r--r--tests/BlurTest.cpp1
-rw-r--r--tests/ClampRangeTest.cpp2
-rw-r--r--tests/ClipStackTest.cpp4
-rw-r--r--tests/ColorFilterTest.cpp2
-rw-r--r--tests/ColorTest.cpp4
-rw-r--r--tests/DrawBitmapRectTest.cpp6
-rw-r--r--tests/GrMemoryPoolTest.cpp6
-rw-r--r--tests/InfRectTest.cpp2
-rw-r--r--tests/LListTest.cpp2
-rw-r--r--tests/MathTest.cpp8
-rw-r--r--tests/MatrixTest.cpp2
-rw-r--r--tests/PackBitsTest.cpp2
-rw-r--r--tests/PathTest.cpp8
-rw-r--r--tests/PictureTest.cpp12
-rw-r--r--tests/RTreeTest.cpp8
-rw-r--r--tests/RegionTest.cpp10
-rw-r--r--tests/Sk64Test.cpp2
-rw-r--r--tests/SortTest.cpp4
-rw-r--r--tests/StreamTest.cpp6
-rw-r--r--tests/UtilsTest.cpp2
-rw-r--r--tests/Writer32Test.cpp2
27 files changed, 56 insertions, 57 deletions
diff --git a/src/core/SkFloat.cpp b/src/core/SkFloat.cpp
index b5cc4f18e7..721d8ec53e 100644
--- a/src/core/SkFloat.cpp
+++ b/src/core/SkFloat.cpp
@@ -291,7 +291,7 @@ void SkFloat::UnitTest()
d.setAdd(c, b);
SkDebugf("SkFloat: %d + %d = %d\n", c.getInt(), b.getInt(), d.getInt());
- SkRandom rand;
+ SkMWCRandom rand;
int i;
for (i = 0; i < 1000; i++)
diff --git a/src/core/SkGraphics.cpp b/src/core/SkGraphics.cpp
index 873d5466da..8e7c7cd31d 100644
--- a/src/core/SkGraphics.cpp
+++ b/src/core/SkGraphics.cpp
@@ -19,7 +19,6 @@
#include "SkPath.h"
#include "SkPathEffect.h"
#include "SkPixelRef.h"
-#include "SkRandom.h"
#include "SkRefCnt.h"
#include "SkRTConf.h"
#include "SkScalerContext.h"
diff --git a/src/core/SkMatrix.cpp b/src/core/SkMatrix.cpp
index d420dd3b92..d9675f3979 100644
--- a/src/core/SkMatrix.cpp
+++ b/src/core/SkMatrix.cpp
@@ -1808,7 +1808,7 @@ SkScalar SkMatrix::getMaxStretch() const {
SkScalar largerRoot;
SkScalar bSqd = SkScalarMul(b,b);
// if upper left 2x2 is orthogonal save some math
- if (bSqd <= SK_ScalarNearlyZero) {
+ if (bSqd <= SK_ScalarNearlyZero*SK_ScalarNearlyZero) {
largerRoot = SkMaxScalar(a, c);
} else {
SkScalar aminusc = a - c;
diff --git a/src/gpu/GrRedBlackTree.h b/src/gpu/GrRedBlackTree.h
index 2ccf77fb50..ba03be2950 100644
--- a/src/gpu/GrRedBlackTree.h
+++ b/src/gpu/GrRedBlackTree.h
@@ -950,7 +950,7 @@ void GrRedBlackTree<T,C>::UnitTest() {
GrRedBlackTree<int> tree;
typedef GrRedBlackTree<int>::Iter iter;
- SkRandom r;
+ SkMWCRandom r;
int count[100] = {0};
// add 10K ints
diff --git a/src/gpu/gl/GrGLEffectMatrix.h b/src/gpu/gl/GrGLEffectMatrix.h
index 49ddceb129..1a11656534 100644
--- a/src/gpu/gl/GrGLEffectMatrix.h
+++ b/src/gpu/gl/GrGLEffectMatrix.h
@@ -12,7 +12,6 @@
#include "SkMatrix.h"
class GrTexture;
-class SkRandom;
/**
* This is a helper to implement a texture matrix in a GrGLEffect.
diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp
index 5c1d4e1720..4c4ee60d0c 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(SkRandom& rand, int n) {
+static SkIRect rand_rect(SkMWCRandom& 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(SkRandom& rand, int n) {
return SkIRect::MakeXYWH(x, y, w, h);
}
-static void make_rand_rgn(SkRegion* rgn, SkRandom& rand) {
+static void make_rand_rgn(SkRegion* rgn, SkMWCRandom& 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) {
- SkRandom rand;
+ SkMWCRandom 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, SkRandom& rand) {
+static void rand_irect(SkIRect* r, int N, SkMWCRandom& 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, SkRandom& rand) {
}
static void test_irect(skiatest::Reporter* reporter) {
- SkRandom rand;
+ SkMWCRandom rand;
for (int i = 0; i < 10000; i++) {
SkAAClip clip0, clip1;
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp
index c0d16f8f3f..57dc940a6d 100644
--- a/tests/BlurTest.cpp
+++ b/tests/BlurTest.cpp
@@ -10,7 +10,6 @@
#include "SkCanvas.h"
#include "SkMath.h"
#include "SkPaint.h"
-#include "SkRandom.h"
///////////////////////////////////////////////////////////////////////////////
diff --git a/tests/ClampRangeTest.cpp b/tests/ClampRangeTest.cpp
index fa3804eccb..dc520711a3 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);
- SkRandom rand;
+ SkMWCRandom rand;
// test non-overflow cases
for (int i = 0; i < 1000000; i++) {
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index 4709d22871..4de667367e 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -820,7 +820,7 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
add_oval,
};
- SkRandom r;
+ SkMWCRandom r;
for (int i = 0; i < kNumTests; ++i) {
// Randomly generate a clip stack.
@@ -864,7 +864,7 @@ static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
ElementList reducedClips;
GrReducedClip::InitialState initial;
- SkIRect tBounds;
+ SkIRect tBounds(inflatedIBounds);
SkIRect* tightBounds = r.nextBool() ? &tBounds : NULL;
GrReducedClip::ReduceClipStack(stack,
inflatedIBounds,
diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp
index 4016f2193d..02256493fa 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) {
- SkRandom rand;
+ SkMWCRandom rand;
for (int mode = 0; mode <= SkXfermode::kLastMode; mode++) {
SkColor color = rand.nextU();
diff --git a/tests/ColorTest.cpp b/tests/ColorTest.cpp
index a720ff4eac..c6e5485080 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) {
- SkRandom r;
+ SkMWCRandom 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) {
- SkRandom r;
+ SkMWCRandom r;
U8CPU a0 = 0;
U8CPU a255 = 255;
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
index ce33fcf89d..19170048f9 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, SkRandom& rand, unsigned mask) {
+static void rand_matrix(SkMatrix* mat, SkMWCRandom& 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, SkRandom& rand, unsigned mask) {
}
}
-static void rand_size(SkISize* size, SkRandom& rand) {
+static void rand_size(SkISize* size, SkMWCRandom& rand) {
size->set(rand.nextU() & 0xFFFF, rand.nextU() & 0xFFFF);
}
@@ -43,7 +43,7 @@ static void test_treatAsSprite(skiatest::Reporter* reporter) {
SkMatrix mat;
SkISize size;
- SkRandom rand;
+ SkMWCRandom rand;
// assert: translate-only no-filter can always be treated as sprite
for (int i = 0; i < 1000; ++i) {
diff --git a/tests/GrMemoryPoolTest.cpp b/tests/GrMemoryPoolTest.cpp
index 8660ea2a3b..73f26a9b2e 100644
--- a/tests/GrMemoryPoolTest.cpp
+++ b/tests/GrMemoryPoolTest.cpp
@@ -47,7 +47,7 @@ public:
SK_DECLARE_INST_COUNT_ROOT(A);
- static A* Create(SkRandom* r);
+ static A* Create(SkMWCRandom* 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(SkRandom* r) {
+A* A::Create(SkMWCRandom* 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;
- SkRandom r;
+ SkMWCRandom 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 4d957dcf75..95ef4be3ef 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());
}
- SkRandom rand;
+ SkMWCRandom rand;
for (int i = 0; i < 10000; ++i) {
SkIRect r;
diff --git a/tests/LListTest.cpp b/tests/LListTest.cpp
index ab36ef53ce..7c03ab579c 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;
- SkRandom random;
+ SkMWCRandom random;
for (int i = 1; i <= 16; i *= 2) {
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index 7fc53a9285..105a3e4bdf 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -173,7 +173,7 @@ static void check_length(skiatest::Reporter* reporter,
REPORTER_ASSERT(reporter, len > 0.999f && len < 1.001f);
}
-static float nextFloat(SkRandom& rand) {
+static float nextFloat(SkMWCRandom& rand) {
SkFloatIntUnion data;
data.fSignBitInt = rand.nextU();
return data.fFloat;
@@ -247,7 +247,7 @@ static void test_int2float(skiatest::Reporter* reporter, int ival) {
}
static void unittest_fastfloat(skiatest::Reporter* reporter) {
- SkRandom rand;
+ SkMWCRandom rand;
size_t i;
static const float gFloats[] = {
@@ -368,7 +368,7 @@ static void test_copysign(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, sk_float_copysign(x, y) == expected);
}
- SkRandom rand;
+ SkMWCRandom rand;
for (int j = 0; j < 1000; j++) {
int ix = rand.nextS();
REPORTER_ASSERT(reporter, SkCopySign32(ix, ix) == ix);
@@ -387,7 +387,7 @@ static void test_copysign(skiatest::Reporter* reporter) {
static void TestMath(skiatest::Reporter* reporter) {
int i;
int32_t x;
- SkRandom rand;
+ SkMWCRandom rand;
// these should assert
#if 0
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index 56292dc525..022e4012c7 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -168,7 +168,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);
}
- SkRandom rand;
+ SkMWCRandom rand;
for (int m = 0; m < 1000; ++m) {
SkMatrix mat;
mat.reset();
diff --git a/tests/PackBitsTest.cpp b/tests/PackBitsTest.cpp
index f7d4b8e6b1..59c8a8cab9 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 SkRandom gRand;
+static SkMWCRandom 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/PathTest.cpp b/tests/PathTest.cpp
index a52e540f48..d8da95b23d 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -290,7 +290,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) {
- SkRandom rand;
+ SkMWCRandom rand;
SkRect r;
for (int i = 0; i < 5000; ++i) {
@@ -317,7 +317,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) {
- SkRandom rand;
+ SkMWCRandom rand;
SkRect r;
for (int i = 0; i < 5000; ++i) {
@@ -452,7 +452,7 @@ DONE:
static void test_addPoly(skiatest::Reporter* reporter) {
SkPoint pts[32];
- SkRandom rand;
+ SkMWCRandom rand;
for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
pts[i].fX = rand.nextSScalar1();
@@ -1862,7 +1862,7 @@ static void test_raw_iter(skiatest::Reporter* reporter) {
}
// Max of 10 segments, max 3 points per segment
- SkRandom rand(9876543);
+ SkMWCRandom rand(9876543);
SkPoint expectedPts[31]; // May have leading moveTo
SkPath::Verb expectedVerbs[22]; // May have leading moveTo
SkPath::Verb nextVerb;
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 0a562cf27b..6adfd5a9be 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -73,7 +73,7 @@ static SkPicture* record_bitmaps(const SkBitmap bm[], const SkPoint pos[],
return pic;
}
-static void rand_rect(SkRect* rect, SkRandom& rand, SkScalar W, SkScalar H) {
+static void rand_rect(SkRect* rect, SkMWCRandom& 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);
@@ -176,7 +176,7 @@ static void test_gatherpixelrefs(skiatest::Reporter* reporter) {
drawbitmap_proc, drawbitmaprect_proc, drawshader_proc
};
- SkRandom rand;
+ SkMWCRandom rand;
for (size_t k = 0; k < SK_ARRAY_COUNT(procs); ++k) {
SkAutoTUnref<SkPicture> pic(record_bitmaps(bm, pos, N, procs[k]));
@@ -259,7 +259,7 @@ static void test_serializing_empty_picture() {
}
#endif
-static void rand_op(SkCanvas* canvas, SkRandom& rand) {
+static void rand_op(SkCanvas* canvas, SkMWCRandom& rand) {
SkPaint paint;
SkRect rect = SkRect::MakeWH(50, 50);
@@ -280,10 +280,10 @@ static void rand_op(SkCanvas* canvas, SkRandom& rand) {
}
static void test_peephole() {
- SkRandom rand;
+ SkMWCRandom rand;
for (int j = 0; j < 100; j++) {
- SkRandom rand2(rand.getSeed()); // remember the seed
+ SkMWCRandom rand2(rand); // remember the seed
SkPicture picture;
SkCanvas* canvas = picture.beginRecording(100, 100);
@@ -292,6 +292,8 @@ static void test_peephole() {
rand_op(canvas, rand);
}
picture.endRecording();
+
+ rand = rand2;
}
{
diff --git a/tests/RTreeTest.cpp b/tests/RTreeTest.cpp
index 6962c89fb0..6296c4e7b8 100644
--- a/tests/RTreeTest.cpp
+++ b/tests/RTreeTest.cpp
@@ -23,7 +23,7 @@ struct DataRect {
void* data;
};
-static SkIRect random_rect(SkRandom& rand) {
+static SkIRect random_rect(SkMWCRandom& rand) {
SkIRect rect = {0,0,0,0};
while (rect.isEmpty()) {
rect.fLeft = rand.nextS() % 1000;
@@ -35,7 +35,7 @@ static SkIRect random_rect(SkRandom& rand) {
return rect;
}
-static void random_data_rects(SkRandom& rand, DataRect out[], int n) {
+static void random_data_rects(SkMWCRandom& 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 runQueries(skiatest::Reporter* reporter, SkRandom& rand, DataRect rects[],
+static void runQueries(skiatest::Reporter* reporter, SkMWCRandom& rand, DataRect rects[],
SkRTree& tree) {
for (size_t i = 0; i < NUM_QUERIES; ++i) {
SkTDArray<void*> hits;
@@ -80,7 +80,7 @@ static void runQueries(skiatest::Reporter* reporter, SkRandom& rand, DataRect re
static void TestRTree(skiatest::Reporter* reporter) {
DataRect rects[NUM_RECTS];
- SkRandom rand;
+ SkMWCRandom rand;
SkRTree* rtree = SkRTree::Create(MIN_CHILDREN, MAX_CHILDREN);
SkAutoUnref au(rtree);
REPORTER_ASSERT(reporter, NULL != rtree);
diff --git a/tests/RegionTest.cpp b/tests/RegionTest.cpp
index 5d3946ebfe..1c06d7ecde 100644
--- a/tests/RegionTest.cpp
+++ b/tests/RegionTest.cpp
@@ -98,7 +98,7 @@ enum {
H = 256
};
-static SkIRect randRect(SkRandom& rand) {
+static SkIRect randRect(SkMWCRandom& rand) {
int x = rand.nextU() % W;
int y = rand.nextU() % H;
int w = rand.nextU() % W;
@@ -106,7 +106,7 @@ static SkIRect randRect(SkRandom& rand) {
return SkIRect::MakeXYWH(x, y, w >> 1, h >> 1);
}
-static void randRgn(SkRandom& rand, SkRegion* rgn, int n) {
+static void randRgn(SkMWCRandom& 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&)) {
- SkRandom rand;
+ SkMWCRandom 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, SkRandom& rand) {
+static void rand_rect(SkIRect* rect, SkMWCRandom& 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)));
- SkRandom rand;
+ SkMWCRandom rand;
for (int i = 0; i < 1000; i++) {
SkRegion rgn0, rgn1;
diff --git a/tests/Sk64Test.cpp b/tests/Sk64Test.cpp
index 50b7ec7d2f..e956cbbd51 100644
--- a/tests/Sk64Test.cpp
+++ b/tests/Sk64Test.cpp
@@ -75,7 +75,7 @@ static void TestSk64(skiatest::Reporter* reporter) {
// Now test add/sub
- SkRandom rand;
+ SkMWCRandom rand;
int i;
for (i = 0; i < 1000; i++)
diff --git a/tests/SortTest.cpp b/tests/SortTest.cpp
index 28c6e682de..6bfb300a72 100644
--- a/tests/SortTest.cpp
+++ b/tests/SortTest.cpp
@@ -15,7 +15,7 @@ extern "C" {
}
}
-static void rand_array(SkRandom& rand, int array[], int n) {
+static void rand_array(SkMWCRandom& 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)];
- SkRandom rand;
+ SkMWCRandom rand;
for (int i = 0; i < 10000; i++) {
int count = rand.nextRangeU(1, SK_ARRAY_COUNT(randomArray));
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index 317451112d..2b86e7bca3 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -17,7 +17,7 @@
#define MAX_SIZE (256 * 1024)
-static void random_fill(SkRandom& rand, void* buffer, size_t size) {
+static void random_fill(SkMWCRandom& rand, void* buffer, size_t size) {
char* p = (char*)buffer;
char* stop = p + size;
while (p < stop) {
@@ -26,7 +26,7 @@ static void random_fill(SkRandom& rand, void* buffer, size_t size) {
}
static void test_buffer(skiatest::Reporter* reporter) {
- SkRandom rand;
+ SkMWCRandom rand;
SkAutoMalloc am(MAX_SIZE * 2);
char* storage = (char*)am.get();
char* storage2 = storage + MAX_SIZE;
@@ -62,7 +62,7 @@ static void TestRStream(skiatest::Reporter* reporter) {
static const char s[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
char copy[sizeof(s)];
- SkRandom rand;
+ SkMWCRandom rand;
for (int i = 0; i < 65; i++) {
char* copyPtr = copy;
diff --git a/tests/UtilsTest.cpp b/tests/UtilsTest.cpp
index 7f27f7e78e..bdabb57de0 100644
--- a/tests/UtilsTest.cpp
+++ b/tests/UtilsTest.cpp
@@ -54,7 +54,7 @@ static void test_autounref(skiatest::Reporter* reporter) {
static void test_search(skiatest::Reporter* reporter) {
int i, array[kSEARCH_COUNT];
- SkRandom rand;
+ SkMWCRandom rand;
for (i = 0; i < kSEARCH_COUNT; i++) {
array[i] = rand.nextS();
diff --git a/tests/Writer32Test.cpp b/tests/Writer32Test.cpp
index 33777a1af7..498be9cb81 100644
--- a/tests/Writer32Test.cpp
+++ b/tests/Writer32Test.cpp
@@ -134,7 +134,7 @@ static void testWritePad(skiatest::Reporter* reporter, SkWriter32* writer) {
SkAutoMalloc originalData(dataSize);
{
- SkRandom rand(0);
+ SkMWCRandom rand(0);
uint32_t* ptr = static_cast<uint32_t*>(originalData.get());
uint32_t* stop = ptr + (dataSize>>2);
while (ptr < stop) {