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
diff --git a/bench/AAClipBench.cpp b/bench/AAClipBench.cpp
index 276a8ff..ef5ba15 100644
--- a/bench/AAClipBench.cpp
+++ b/bench/AAClipBench.cpp
@@ -94,7 +94,7 @@
     SkString fName;
     bool     fDoAA;
     SkRect   fDrawRect;
-    SkRandom fRandom;
+    SkMWCRandom fRandom;
 
     static const int kNumDraws = SkBENCHLOOP(2);
     static const int kNestingDepth = 3;
diff --git a/bench/BicubicBench.cpp b/bench/BicubicBench.cpp
index a3a2318..1aa2dbd 100644
--- a/bench/BicubicBench.cpp
+++ b/bench/BicubicBench.cpp
@@ -37,7 +37,7 @@
 
         paint.setAntiAlias(true);
 
-        SkRandom rand;
+        SkMWCRandom 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 a472d24..9291342 100644
--- a/bench/BitmapBench.cpp
+++ b/bench/BitmapBench.cpp
@@ -137,7 +137,7 @@
 
     virtual void onDraw(SkCanvas* canvas) {
         SkIPoint dim = this->getSize();
-        SkRandom rand;
+        SkMWCRandom rand;
 
         SkPaint paint(fPaint);
         this->setupPaint(&paint);
diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp
index c147da2..aee0eec 100644
--- a/bench/BitmapRectBench.cpp
+++ b/bench/BitmapRectBench.cpp
@@ -86,7 +86,7 @@
 
 
     virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
-        SkRandom rand;
+        SkMWCRandom rand;
 
         SkPaint paint;
         this->setupPaint(&paint);
diff --git a/bench/BlurBench.cpp b/bench/BlurBench.cpp
index 67a600b..a66dac0 100644
--- a/bench/BlurBench.cpp
+++ b/bench/BlurBench.cpp
@@ -59,7 +59,7 @@
 
         paint.setAntiAlias(true);
 
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < SkBENCHLOOP(10); i++) {
             SkRect r = SkRect::MakeWH(rand.nextUScalar1() * 400,
                                       rand.nextUScalar1() * 400);
diff --git a/bench/ChecksumBench.cpp b/bench/ChecksumBench.cpp
index 315402e..bc13ec5 100644
--- a/bench/ChecksumBench.cpp
+++ b/bench/ChecksumBench.cpp
@@ -30,7 +30,7 @@
 
 public:
     ComputeChecksumBench(void* param, ChecksumType type) : INHERITED(param), fType(type) {
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < U32COUNT; ++i) {
             fData[i] = rand.nextU();
         }
diff --git a/bench/GrMemoryPoolBench.cpp b/bench/GrMemoryPoolBench.cpp
index dccf827..78a283b 100644
--- a/bench/GrMemoryPoolBench.cpp
+++ b/bench/GrMemoryPoolBench.cpp
@@ -47,7 +47,7 @@
     }
 
     virtual void onDraw(SkCanvas*) {
-        SkRandom r;
+        SkMWCRandom r;
         enum {
             kMaxObjects = 4 * (1 << 10),
         };
@@ -103,7 +103,7 @@
     }
 
     virtual void onDraw(SkCanvas*) {
-        SkRandom r;
+        SkMWCRandom r;
         enum {
             kMaxObjects = 4 * (1 << 10),
         };
@@ -141,7 +141,7 @@
     }
 
     virtual void onDraw(SkCanvas*) {
-        SkRandom r;
+        SkMWCRandom 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 f5b30a3..ca3797b 100644
--- a/bench/HairlinePathBench.cpp
+++ b/bench/HairlinePathBench.cpp
@@ -85,7 +85,7 @@
         name->append("line");
     }
     virtual void makePath(SkPath* path) SK_OVERRIDE {
-        SkRandom rand;
+        SkMWCRandom rand;
         int size = SK_ARRAY_COUNT(points);
         int hSize = size / 2;
         for (int i = 0; i < kMaxPathSize; ++i) {
@@ -117,7 +117,7 @@
         name->append("quad");
     }
     virtual void makePath(SkPath* path) SK_OVERRIDE {
-        SkRandom rand;
+        SkMWCRandom rand;
         int size = SK_ARRAY_COUNT(points);
         int hSize = size / 2;
         for (int i = 0; i < kMaxPathSize; ++i) {
@@ -149,8 +149,8 @@
         name->append("conic");
     }
     virtual void makePath(SkPath* path) SK_OVERRIDE {
-        SkRandom rand;
-        SkRandom randWeight;
+        SkMWCRandom rand;
+        SkMWCRandom randWeight;
         int size = SK_ARRAY_COUNT(points);
         int hSize = size / 2;
         for (int i = 0; i < kMaxPathSize; ++i) {
@@ -184,7 +184,7 @@
         name->append("cubic");
     }
     virtual void makePath(SkPath* path) SK_OVERRIDE {
-        SkRandom rand;
+        SkMWCRandom 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 feaae2b..6907435 100644
--- a/bench/LineBench.cpp
+++ b/bench/LineBench.cpp
@@ -32,7 +32,7 @@
         fDoAA = doAA;
         fName.printf("lines_%g_%s", width, doAA ? "AA" : "BW");
 
-        SkRandom rand;
+        SkMWCRandom 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 32a89d6..5470924 100644
--- a/bench/MathBench.cpp
+++ b/bench/MathBench.cpp
@@ -26,7 +26,7 @@
     MathBench(void* param, const char name[]) : INHERITED(param) {
         fName.printf("math_%s", name);
 
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < kBuffer; ++i) {
             fSrc[i] = rand.nextSScalar1();
         }
@@ -254,7 +254,7 @@
 public:
 
     IsFiniteBench(void* param, int index) : INHERITED(param) {
-        SkRandom rand;
+        SkMWCRandom rand;
 
         for (int i = 0; i < N; ++i) {
             fData[i] = rand.nextSScalar1();
@@ -322,7 +322,7 @@
 public:
 
     FloorBench(void* param, bool fast) : INHERITED(param), fFast(fast) {
-        SkRandom rand;
+        SkMWCRandom rand;
 
         for (int i = 0; i < ARRAY; ++i) {
             fData[i] = rand.nextSScalar1();
@@ -340,7 +340,7 @@
 
 protected:
     virtual void onDraw(SkCanvas*) {
-        SkRandom rand;
+        SkMWCRandom rand;
         float accum = 0;
         const float* data = fData;
 
@@ -384,7 +384,7 @@
         : INHERITED(param)
         , fUsePortable(usePortable) {
 
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < ARRAY; ++i) {
             fData[i] = rand.nextU();
         }
@@ -444,7 +444,7 @@
     NormalizeBench(void* param)
     : INHERITED(param) {
 
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < ARRAY; ++i) {
             fVec[i].set(rand.nextSScalar1(), rand.nextSScalar1());
         }
@@ -490,7 +490,7 @@
 public:
 
     FixedMathBench(void* param) : INHERITED(param) {
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < N; ++i) {
             fData[i] = rand.nextSScalar1();
         }
diff --git a/bench/MatrixBench.cpp b/bench/MatrixBench.cpp
index 8fe9e34..e7054d4 100644
--- a/bench/MatrixBench.cpp
+++ b/bench/MatrixBench.cpp
@@ -95,7 +95,7 @@
 // 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]) {
-    SkRandom rand;
+    SkMWCRandom rand;
     for (int i = 0; i < 9; i++) {
         array[i] = rand.nextSScalar1();
     }
@@ -261,7 +261,7 @@
 private:
     SkMatrix fMatrix;
     float fArray[9];
-    SkRandom fRnd;
+    SkMWCRandom fRnd;
     typedef MatrixBench INHERITED;
 };
 
@@ -302,7 +302,7 @@
     SkMatrix fMatrix;
     SkPoint fSrc [16];
     SkPoint fDst [16];
-    SkRandom fRandom;
+    SkMWCRandom fRandom;
     typedef MatrixBench INHERITED;
 };
 
@@ -342,7 +342,7 @@
     double fMatrix [9];
     SkPoint fSrc [16];
     SkPoint fDst [16];
-    SkRandom fRandom;
+    SkMWCRandom fRandom;
     typedef MatrixBench INHERITED;
 };
 
diff --git a/bench/MatrixConvolutionBench.cpp b/bench/MatrixConvolutionBench.cpp
index 161fc23..82ac78c 100644
--- a/bench/MatrixConvolutionBench.cpp
+++ b/bench/MatrixConvolutionBench.cpp
@@ -39,7 +39,7 @@
         SkPaint paint;
         this->setupPaint(&paint);
         paint.setAntiAlias(true);
-        SkRandom rand;
+        SkMWCRandom 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 f9657ba..961721d 100644
--- a/bench/MorphologyBench.cpp
+++ b/bench/MorphologyBench.cpp
@@ -59,7 +59,7 @@
 
         paint.setAntiAlias(true);
 
-        SkRandom rand;
+        SkMWCRandom 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 057a2b0..967f501 100644
--- a/bench/PathBench.cpp
+++ b/bench/PathBench.cpp
@@ -183,7 +183,7 @@
         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 @@
         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 @@
     int                         fCurrPath;
     int                         fCurrVerb;
     int                         fCurrPoint;
-    SkRandom                    fRandom;
+    SkMWCRandom                 fRandom;
     typedef SkBenchmark INHERITED;
 };
 
@@ -653,7 +653,7 @@
             paint.setStyle(SkPaint::kStroke_Style);
         }
 
-        SkRandom rand;
+        SkMWCRandom rand;
 
         SkRect r;
 
@@ -754,7 +754,7 @@
     }
 
     virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
-        SkRandom rand;
+        SkMWCRandom rand;
         SkRect r;
 
         for (int i = 0; i < 5000; ++i) {
@@ -834,7 +834,7 @@
     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 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-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 @@
 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);
         }
diff --git a/bench/PathIterBench.cpp b/bench/PathIterBench.cpp
index 987a752..e560ff7 100644
--- a/bench/PathIterBench.cpp
+++ b/bench/PathIterBench.cpp
@@ -14,7 +14,7 @@
 #include "SkShader.h"
 #include "SkString.h"
 
-static int rand_pts(SkRandom& rand, SkPoint pts[4]) {
+static int rand_pts(SkMWCRandom& rand, SkPoint pts[4]) {
     int n = rand.nextU() & 3;
     n += 1;
 
@@ -37,7 +37,7 @@
         fName.printf("pathiter_%s", raw ? "raw" : "consume");
         fRaw = raw;
 
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < 1000; ++i) {
             SkPoint pts[4];
             int n = rand_pts(rand, pts);
diff --git a/bench/PictureRecordBench.cpp b/bench/PictureRecordBench.cpp
index f23f0cb..1ba3cb3 100644
--- a/bench/PictureRecordBench.cpp
+++ b/bench/PictureRecordBench.cpp
@@ -143,7 +143,7 @@
 protected:
     virtual float innerLoopScale() const SK_OVERRIDE { return 0.1f; }
     virtual void recordCanvas(SkCanvas* canvas) {
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < M; i++) {
             SkPaint paint;
             paint.setColor(rand.nextU());
@@ -167,7 +167,7 @@
 public:
     RecurringPaintDictionaryRecordBench(void* param)
         : INHERITED(param, "recurring_paint_dictionary") {
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < ObjCount; i++) {
             fPaint[i].setColor(rand.nextU());
         }
diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp
index 99ff0a9..e3d0e24 100644
--- a/bench/RectBench.cpp
+++ b/bench/RectBench.cpp
@@ -27,7 +27,7 @@
         : INHERITED(param)
         , fShift(shift)
         , fStroke(stroke) {
-        SkRandom rand;
+        SkMWCRandom rand;
         const SkScalar offset = SK_Scalar1/3;
         for (int i = 0; i < N; i++) {
             int x = rand.nextU() % W;
@@ -246,7 +246,7 @@
             gSizes[0] = this->getStrokeWidth();
             sizes = 1;
         }
-        SkRandom rand;
+        SkMWCRandom rand;
         SkColor color = 0xFF000000;
         U8CPU alpha = 0xFF;
         SkPaint paint;
diff --git a/bench/RegionBench.cpp b/bench/RegionBench.cpp
index 7a306e9..4c2ea6e 100644
--- a/bench/RegionBench.cpp
+++ b/bench/RegionBench.cpp
@@ -82,7 +82,7 @@
         N = SkBENCHLOOP(2000)
     };
 
-    SkIRect randrect(SkRandom& rand) {
+    SkIRect randrect(SkMWCRandom& rand) {
         int x = rand.nextU() % W;
         int y = rand.nextU() % H;
         int w = rand.nextU() % W;
@@ -95,7 +95,7 @@
         fName.printf("region_%s_%d", name, count);
         fLoopMul = mul;
 
-        SkRandom rand;
+        SkMWCRandom 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 8668513..40375da 100644
--- a/bench/RegionContainBench.cpp
+++ b/bench/RegionContainBench.cpp
@@ -29,7 +29,7 @@
         N = SkBENCHLOOP(20000)
     };
 
-    SkIRect randrect(SkRandom& rand, int i) {
+    SkIRect randrect(SkMWCRandom& rand, int i) {
         int w = rand.nextU() % W;
         return SkIRect::MakeXYWH(0, i*H/COUNT, w, H/COUNT);
     }
@@ -38,7 +38,7 @@
         fProc = proc;
         fName.printf("region_contains_%s", name);
 
-        SkRandom rand;
+        SkMWCRandom 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 333dd22..405d51e 100644
--- a/bench/ScalarBench.cpp
+++ b/bench/ScalarBench.cpp
@@ -56,7 +56,7 @@
 // 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]) {
-    SkRandom rand;
+    SkMWCRandom rand;
     for (int i = 0; i < 9; i++) {
         array[i] = rand.nextSScalar1();
     }
@@ -102,7 +102,7 @@
 class IsFiniteScalarBench : public ScalarBench {
 public:
     IsFiniteScalarBench(void* param) : INHERITED(param, "isfinite") {
-        SkRandom rand;
+        SkMWCRandom rand;
         for (size_t i = 0; i < ARRAY_N; ++i) {
             fArray[i] = rand.nextSScalar1();
         }
@@ -141,7 +141,7 @@
 
 public:
     RectBoundsBench(void* param) : INHERITED(param) {
-        SkRandom rand;
+        SkMWCRandom 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 0e8e4bb..d2f4e26 100644
--- a/bench/ShaderMaskBench.cpp
+++ b/bench/ShaderMaskBench.cpp
@@ -59,7 +59,7 @@
 
     virtual void onDraw(SkCanvas* canvas) {
         const SkIPoint dim = this->getSize();
-        SkRandom rand;
+        SkMWCRandom rand;
 
         SkPaint paint(fPaint);
         this->setupPaint(&paint);
diff --git a/bench/SortBench.cpp b/bench/SortBench.cpp
index c19ebae..3e46377 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) {
-    SkRandom rand;
+    SkMWCRandom rand;
     for (int i = 0; i < count; ++i) {
         array[i] = rand.nextS();
     }
 }
 
 static void randN_proc(int array[], int count) {
-    SkRandom rand;
+    SkMWCRandom 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 9334c33..4f78e18 100644
--- a/bench/TextBench.cpp
+++ b/bench/TextBench.cpp
@@ -94,7 +94,7 @@
 
     virtual void onDraw(SkCanvas* canvas) {
         const SkIPoint dim = this->getSize();
-        SkRandom rand;
+        SkMWCRandom rand;
 
         SkPaint paint(fPaint);
         this->setupPaint(&paint);
diff --git a/bench/VertBench.cpp b/bench/VertBench.cpp
index 5456e28..564a306 100644
--- a/bench/VertBench.cpp
+++ b/bench/VertBench.cpp
@@ -68,7 +68,7 @@
         SkASSERT(PTS == pts - fPts);
         SkASSERT(IDX == idx - fIdx);
 
-        SkRandom rand;
+        SkMWCRandom rand;
         for (int i = 0; i < PTS; ++i) {
             fColors[i] = rand.nextU() | (0xFF << 24);
         }
diff --git a/samplecode/SampleAnimBlur.cpp b/samplecode/SampleAnimBlur.cpp
index 5d6638a..1109fdf 100644
--- a/samplecode/SampleAnimBlur.cpp
+++ b/samplecode/SampleAnimBlur.cpp
@@ -43,7 +43,7 @@
             SkBlurMaskFilter::kSolid_BlurStyle,
             SkBlurMaskFilter::kOuter_BlurStyle,
         };
-        SkRandom random;
+        SkMWCRandom random;
 
         for (size_t i = 0; i < SK_ARRAY_COUNT(gStyles); ++i) {
             SkMaskFilter* mf = SkBlurMaskFilter::Create(
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index b3632f8..5188588 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -2435,7 +2435,7 @@
 
 #include "SkRandom.h"
 
-static void rand_rect(SkIRect* rect, SkRandom& rand) {
+static void rand_rect(SkIRect* rect, SkMWCRandom& rand) {
     int bits = 8;
     int shift = 32 - bits;
     rect->set(rand.nextU() >> shift, rand.nextU() >> shift,
@@ -2499,7 +2499,7 @@
         test_rects(gRecs[i].fRects, gRecs[i].fCount);
     }
 
-    SkRandom rand;
+    SkMWCRandom rand;
     for (i = 0; i < 10000; i++) {
         SkRegion rgn0, rgn1;
 
diff --git a/samplecode/SampleClip.cpp b/samplecode/SampleClip.cpp
index 3a38724..a35f42c 100644
--- a/samplecode/SampleClip.cpp
+++ b/samplecode/SampleClip.cpp
@@ -17,7 +17,7 @@
 #define H   200
 
 static void show_text(SkCanvas* canvas, bool doAA) {
-    SkRandom rand;
+    SkMWCRandom rand;
     SkPaint paint;
     paint.setAntiAlias(doAA);
     paint.setLCDRenderText(true);
@@ -32,7 +32,7 @@
 }
 
 static void show_fill(SkCanvas* canvas, bool doAA) {
-    SkRandom rand;
+    SkMWCRandom rand;
     SkPaint paint;
     paint.setAntiAlias(doAA);
 
@@ -53,13 +53,13 @@
     }
 }
 
-static SkScalar randRange(SkRandom& rand, SkScalar min, SkScalar max) {
+static SkScalar randRange(SkMWCRandom& rand, SkScalar min, SkScalar max) {
     SkASSERT(min <= max);
     return min + SkScalarMul(rand.nextUScalar1(), max - min);
 }
 
 static void show_stroke(SkCanvas* canvas, bool doAA, SkScalar strokeWidth, int n) {
-    SkRandom rand;
+    SkMWCRandom rand;
     SkPaint paint;
     paint.setAntiAlias(doAA);
     paint.setStyle(SkPaint::kStroke_Style);
diff --git a/samplecode/SampleCull.cpp b/samplecode/SampleCull.cpp
index 18f2d0c..e6b110a 100644
--- a/samplecode/SampleCull.cpp
+++ b/samplecode/SampleCull.cpp
@@ -96,7 +96,7 @@
     return array;
 }
 
-static SkScalar nextScalarRange(SkRandom& rand, SkScalar min, SkScalar max) {
+static SkScalar nextScalarRange(SkMWCRandom& rand, SkScalar min, SkScalar max) {
     return min + SkScalarMul(rand.nextUScalar1(), max - min);
 }
 
@@ -105,7 +105,7 @@
     CullView() {
         fClip.set(0, 0, SkIntToScalar(160), SkIntToScalar(160));
 
-        SkRandom    rand;
+        SkMWCRandom    rand;
 
         for (int i = 0; i < 50; i++) {
             SkScalar x = nextScalarRange(rand, -fClip.width()*1, fClip.width()*2);
diff --git a/samplecode/SampleEmptyPath.cpp b/samplecode/SampleEmptyPath.cpp
index 51c570e..986a088 100644
--- a/samplecode/SampleEmptyPath.cpp
+++ b/samplecode/SampleEmptyPath.cpp
@@ -73,7 +73,7 @@
                          100*SK_Scalar1,
                          titlePaint);
 
-        SkRandom rand;
+        SkMWCRandom rand;
         SkRect rect = SkRect::MakeWH(125*SK_Scalar1, 100*SK_Scalar1);
         int i = 0;
         canvas->save();
diff --git a/samplecode/SampleFontCache.cpp b/samplecode/SampleFontCache.cpp
index c5f4457..050867e 100644
--- a/samplecode/SampleFontCache.cpp
+++ b/samplecode/SampleFontCache.cpp
@@ -16,7 +16,7 @@
 static void call_measure() {
     SkPaint paint;
     uint16_t text[32];
-    SkRandom rand;
+    SkMWCRandom rand;
 
     paint.setAntiAlias(true);
     paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
@@ -35,7 +35,7 @@
 static void call_draw(SkCanvas* canvas) {
     SkPaint paint;
     uint16_t text[32];
-    SkRandom rand;
+    SkMWCRandom rand;
 
     paint.setAntiAlias(true);
     paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
diff --git a/samplecode/SampleHairCurves.cpp b/samplecode/SampleHairCurves.cpp
index 2cf0b3c..421c950 100644
--- a/samplecode/SampleHairCurves.cpp
+++ b/samplecode/SampleHairCurves.cpp
@@ -34,8 +34,8 @@
         paint.setStrokeWidth(0);
         canvas->save();
         canvas->scale(1000 * SK_Scalar1, 1000 * SK_Scalar1);
-        SkRandom rand;
-        SkRandom randW;
+        SkMWCRandom rand;
+        SkMWCRandom randW;
         SkPath curves;
         SkPath hulls;
         SkPath ctrlPts;
diff --git a/samplecode/SamplePathEffects.cpp b/samplecode/SamplePathEffects.cpp
index ac77f21..4c6d03c 100644
--- a/samplecode/SamplePathEffects.cpp
+++ b/samplecode/SamplePathEffects.cpp
@@ -102,7 +102,7 @@
     SkPoint fClickPt;
 public:
     PathEffectView() {
-        SkRandom    rand;
+        SkMWCRandom    rand;
         int         steps = 20;
         SkScalar    dist = SkIntToScalar(400);
         SkScalar    x = SkIntToScalar(20);
diff --git a/samplecode/SamplePicture.cpp b/samplecode/SamplePicture.cpp
index 825e561..8afebc4 100644
--- a/samplecode/SamplePicture.cpp
+++ b/samplecode/SamplePicture.cpp
@@ -165,7 +165,7 @@
 
         // test that we can re-record a subpicture, and see the results
 
-        SkRandom rand(SampleCode::GetAnimTime());
+        SkMWCRandom rand(SampleCode::GetAnimTime());
         canvas->translate(SkIntToScalar(10), SkIntToScalar(250));
         drawCircle(fSubPicture->beginRecording(50, 50), 25,
                    rand.nextU() | 0xFF000000);
diff --git a/samplecode/SamplePoints.cpp b/samplecode/SamplePoints.cpp
index ac2f625..3bb8126 100644
--- a/samplecode/SamplePoints.cpp
+++ b/samplecode/SamplePoints.cpp
@@ -41,7 +41,7 @@
         return this->INHERITED::onQuery(evt);
     }
 
-    static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) {
+    static void fill_pts(SkPoint pts[], size_t n, SkMWCRandom* rand) {
         for (size_t i = 0; i < n; i++)
             pts[i].set(rand->nextUScalar1() * 640, rand->nextUScalar1() * 480);
     }
@@ -49,7 +49,7 @@
     virtual void onDrawContent(SkCanvas* canvas) {
         canvas->translate(SK_Scalar1, SK_Scalar1);
 
-        SkRandom rand;
+        SkMWCRandom rand;
         SkPaint  p0, p1, p2, p3;
         const size_t n = 99;
 
diff --git a/samplecode/SampleRotateCircles.cpp b/samplecode/SampleRotateCircles.cpp
index 1f586be..2dd5be9 100644
--- a/samplecode/SampleRotateCircles.cpp
+++ b/samplecode/SampleRotateCircles.cpp
@@ -38,7 +38,7 @@
     }
 
     virtual void onDrawContent(SkCanvas* canvas) {
-        SkRandom rand;
+        SkMWCRandom rand;
         SkPaint paint;
         paint.setAntiAlias(true);
         paint.setStrokeWidth(20);
diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp
index 98e4e72..7a10246 100644
--- a/samplecode/SampleSlides.cpp
+++ b/samplecode/SampleSlides.cpp
@@ -350,7 +350,7 @@
 
 static void make_tris(Rec* rec) {
     int n = 10;
-    SkRandom    rand;
+    SkMWCRandom    rand;
 
     rec->fMode = SkCanvas::kTriangles_VertexMode;
     rec->fCount = n * 3;
diff --git a/samplecode/SampleStrokePath.cpp b/samplecode/SampleStrokePath.cpp
index ce6a010..dbf6bd4 100644
--- a/samplecode/SampleStrokePath.cpp
+++ b/samplecode/SampleStrokePath.cpp
@@ -132,7 +132,7 @@
         return this->INHERITED::onQuery(evt);
     }
 
-    SkRandom rand;
+    SkMWCRandom rand;
 
     void drawSet(SkCanvas* canvas, SkPaint* paint) {
         SkAutoCanvasRestore acr(canvas, true);
diff --git a/samplecode/SampleText.cpp b/samplecode/SampleText.cpp
index c6aaa52..b4091ff 100644
--- a/samplecode/SampleText.cpp
+++ b/samplecode/SampleText.cpp
@@ -135,7 +135,7 @@
     SkASSERT(mm == width);
 }
 
-static SkRandom gRand;
+static SkMWCRandom gRand;
 
 class SkPowerMode : public SkXfermode {
 public:
@@ -287,7 +287,7 @@
         canvas.drawText(s, strlen(s), SkIntToScalar(8), SkIntToScalar(14), paint);
     }
 
-    static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) {
+    static void fill_pts(SkPoint pts[], size_t n, SkMWCRandom* rand) {
         for (size_t i = 0; i < n; i++)
             pts[i].set(rand->nextUScalar1() * 640, rand->nextUScalar1() * 480);
     }
diff --git a/samplecode/SampleTextAlpha.cpp b/samplecode/SampleTextAlpha.cpp
index 83616f4..8f8ae4f 100644
--- a/samplecode/SampleTextAlpha.cpp
+++ b/samplecode/SampleTextAlpha.cpp
@@ -74,7 +74,7 @@
                                     SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(3))));
         paint.getMaskFilter()->unref();
 
-        SkRandom rand;
+        SkMWCRandom rand;
 
         for (int ps = 6; ps <= 35; ps++) {
             paint.setColor(rand.nextU() | (0xFF << 24));
diff --git a/samplecode/SampleVertices.cpp b/samplecode/SampleVertices.cpp
index 53db2ea..d71a1ae 100644
--- a/samplecode/SampleVertices.cpp
+++ b/samplecode/SampleVertices.cpp
@@ -144,7 +144,7 @@
 
     void make_tris(Rec* rec) {
         int n = 10;
-        SkRandom    rand;
+        SkMWCRandom    rand;
 
         rec->fMode = SkCanvas::kTriangles_VertexMode;
         rec->fCount = n * 3;
diff --git a/tests/BitmapGetColorTest.cpp b/tests/BitmapGetColorTest.cpp
index 11c22e6..06e3760 100644
--- a/tests/BitmapGetColorTest.cpp
+++ b/tests/BitmapGetColorTest.cpp
@@ -10,11 +10,11 @@
 #include "SkRect.h"
 #include "SkRandom.h"
 
-static int nextRand(SkRandom& rand, int min, int max) {
+static int nextRand(SkMWCRandom& rand, int min, int max) {
     return min + (int)rand.nextRangeU(0, max - min);
 }
 
-static void rand_irect(SkIRect* rect, int W, int H, SkRandom& rand) {
+static void rand_irect(SkIRect* rect, int W, int H, SkMWCRandom& rand) {
     const int DX = W / 2;
     const int DY = H / 2;
 
@@ -57,7 +57,7 @@
     bm8.setConfig(SkBitmap::kA8_Config, W, H);
     bm8.allocPixels();
 
-    SkRandom rand;
+    SkMWCRandom rand;
     for (int i = 0; i < 10000; ++i) {
         SkIRect area;
         rand_irect(&area, W, H, rand);
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index fe54594..5ec91a9 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -19,7 +19,7 @@
     REPORTER_ASSERT(reporter, 1 == SkCLZ(1 << 30));
     REPORTER_ASSERT(reporter, 0 == SkCLZ(~0U));
 
-    SkRandom rand;
+    SkMWCRandom 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 @@
     }
 #endif
 
-    SkRandom rand;
+    SkMWCRandom rand;
     for (int i = 0; i < 10000; ++i) {
         unsigned a = rand.nextU() & 0x7FFF;
         unsigned b = rand.nextU() & 0x7FFF;
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index 70d2c1d..0f4973f 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -574,7 +574,7 @@
 
     const int kTripleCount = 1000;
     const int kMatrixCount = 1000;
-    SkRandom rand;
+    SkMWCRandom rand;
 
     SkScalar randTriples[3*kTripleCount];
     for (int i = 0; i < 3*kTripleCount; ++i) {
diff --git a/tests/MipMapTest.cpp b/tests/MipMapTest.cpp
index 3988273..5862d08 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, SkRandom& rand) {
+static void make_bitmap(SkBitmap* bm, SkMWCRandom& 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 TestMipMap(skiatest::Reporter* reporter) {
     SkBitmap bm;
-    SkRandom rand;
+    SkMWCRandom rand;
 
     for (int i = 0; i < 500; ++i) {
         make_bitmap(&bm, rand);
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp
index 38f66ea..a7bbffa 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -71,7 +71,7 @@
         { uni_to_utf32, SkPaint::kUTF32_TextEncoding },
     };
 
-    SkRandom rand;
+    SkMWCRandom rand;
     SkPaint paint;
     paint.setTypeface(SkTypeface::RefDefault())->unref();
     SkTypeface* face = paint.getTypeface();