aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@google.com>2014-12-15 12:54:51 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-15 12:54:51 -0800
commitf9d610179d7d4198b57b12d06f8d1ca09f580df3 (patch)
treed53f2e440ad0173132c5902d0b4a04c8fd5cfcf1
parent9a0d6d6c88b87b3d0195e5633403325b6e922b8c (diff)
There can be only one (SkRandom)!
Remove SkLCGRandom. We already decided the new one was better, which is why we wrote the new SkRandom. Convert GMs that were using SkLCGRandom to use the improved SkRandom. Motivated by the fact that these GMs draw differently on some runs. We believe this to be a result of using the old SkLCGRandom. Add each of the tests that were using SkLCGRandom to ignore-tests.txt, since we expect they'll draw differently using SkRandom. Move a trimmed down version of SkLCGRandom into SkDiscretePathEffect. In order to preserve the old behavior, trim down SkLCGRandom to only the methods used by SkDiscretePathEffect, and hide it in SkDiscretePathEffect's cpp file. BUG=skia:3241 Review URL: https://codereview.chromium.org/805963002
-rw-r--r--expectations/gm/ignored-tests.txt26
-rwxr-xr-xgm/beziers.cpp6
-rw-r--r--gm/circles.cpp2
-rw-r--r--gm/complexclip2.cpp2
-rw-r--r--gm/convexpaths.cpp2
-rw-r--r--gm/cubicpaths.cpp4
-rw-r--r--gm/degeneratesegments.cpp2
-rw-r--r--gm/emptypath.cpp2
-rw-r--r--gm/getpostextpath.cpp2
-rw-r--r--gm/hittestpath.cpp2
-rw-r--r--gm/linepaths.cpp4
-rw-r--r--gm/points.cpp4
-rw-r--r--gm/polygons.cpp4
-rw-r--r--gm/quadpaths.cpp4
-rw-r--r--gm/strokerects.cpp4
-rw-r--r--gm/strokes.cpp8
-rw-r--r--include/utils/SkRandom.h139
-rw-r--r--src/effects/SkDiscretePathEffect.cpp51
-rwxr-xr-xtests/StrokerTest.cpp16
19 files changed, 106 insertions, 178 deletions
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt
index 4ba3181650..eb7609f07c 100644
--- a/expectations/gm/ignored-tests.txt
+++ b/expectations/gm/ignored-tests.txt
@@ -60,3 +60,29 @@ drawbitmapmatrix
#junov skbug.com/3176
pictureimagefilter
+#scroggo skbug.com/3241
+# replacing SkLCGRandom with SkRandom
+beziers
+circles
+complexclip2
+complexclip2_rect_aa
+complexclip2_rect_bw
+complexclip2_path_aa
+complexclip2_path_bw
+complexclip2_rrect_aa
+complexclip2_rrect_bw
+cubicpath
+cubicclosepath
+degeneratesegments
+emptypath
+getpostextpath
+hittestpath
+linepath
+lineclosepath
+points
+polygons
+quadpath
+quadclosepath
+strokerects
+strokes_round
+strokes_poly
diff --git a/gm/beziers.cpp b/gm/beziers.cpp
index 48033bb385..2371fdd0eb 100755
--- a/gm/beziers.cpp
+++ b/gm/beziers.cpp
@@ -14,7 +14,7 @@
static const SkScalar SH = SkIntToScalar(H);
-static void rnd_quad(SkPath* p, SkPaint* paint, SkLCGRandom& rand) {
+static void rnd_quad(SkPath* p, SkPaint* paint, SkRandom& rand) {
p->moveTo(rand.nextRangeScalar(0, W), rand.nextRangeScalar(0, H));
for (int x = 0; x < 2; ++x) {
p->quadTo(rand.nextRangeScalar(W / 4, W), rand.nextRangeScalar(0, H),
@@ -27,7 +27,7 @@ static void rnd_quad(SkPath* p, SkPaint* paint, SkLCGRandom& rand) {
paint->setAlpha(0xFF);
}
-static void rnd_cubic(SkPath* p, SkPaint* paint, SkLCGRandom& rand) {
+static void rnd_cubic(SkPath* p, SkPaint* paint, SkRandom& rand) {
p->moveTo(rand.nextRangeScalar(0, W), rand.nextRangeScalar(0, H));
for (int x = 0; x < 2; ++x) {
p->cubicTo(rand.nextRangeScalar(W / 4, W), rand.nextRangeScalar(0, H),
@@ -64,7 +64,7 @@ protected:
paint.setStrokeWidth(SkIntToScalar(9)/2);
paint.setAntiAlias(true);
- SkLCGRandom rand;
+ SkRandom rand;
for (int i = 0; i < N; i++) {
SkPath p;
rnd_quad(&p, &paint, rand);
diff --git a/gm/circles.cpp b/gm/circles.cpp
index 2c9368be92..6fa682c266 100644
--- a/gm/circles.cpp
+++ b/gm/circles.cpp
@@ -156,7 +156,6 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- SkLCGRandom rand;
// Draw a giant AA circle as the background.
SkISize size = this->getISize();
SkScalar giantRadius = SkTMin(SkIntToScalar(size.fWidth),
@@ -168,6 +167,7 @@ protected:
giantPaint.setColor(0x80808080);
canvas->drawCircle(giantCenter.fX, giantCenter.fY, giantRadius, giantPaint);
+ SkRandom rand;
canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1);
int i;
for (i = 0; i < fPaints.count(); ++i) {
diff --git a/gm/complexclip2.cpp b/gm/complexclip2.cpp
index f99d5b484d..8688c86465 100644
--- a/gm/complexclip2.cpp
+++ b/gm/complexclip2.cpp
@@ -81,7 +81,7 @@ public:
SkRegion::kReplace_Op,
};
- SkLCGRandom r;
+ SkRandom r;
for (int i = 0; i < kRows; ++i) {
for (int j = 0; j < kCols; ++j) {
for (int k = 0; k < 5; ++k) {
diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp
index b869887a97..4f9633d8b7 100644
--- a/gm/convexpaths.cpp
+++ b/gm/convexpaths.cpp
@@ -265,7 +265,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- SkLCGRandom rand;
+ SkRandom rand;
canvas->translate(20 * SK_Scalar1, 20 * SK_Scalar1);
// As we've added more paths this has gotten pretty big. Scale the whole thing down.
diff --git a/gm/cubicpaths.cpp b/gm/cubicpaths.cpp
index f171522caa..9c6cffbdb3 100644
--- a/gm/cubicpaths.cpp
+++ b/gm/cubicpaths.cpp
@@ -140,7 +140,7 @@ protected:
20 * SK_Scalar1,
titlePaint);
- SkLCGRandom rand;
+ SkRandom rand;
SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1);
canvas->save();
canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1);
@@ -290,7 +290,7 @@ protected:
20 * SK_Scalar1,
titlePaint);
- SkLCGRandom rand;
+ SkRandom rand;
SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1);
canvas->save();
canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1);
diff --git a/gm/degeneratesegments.cpp b/gm/degeneratesegments.cpp
index 17bf83bddc..5435d533f8 100644
--- a/gm/degeneratesegments.cpp
+++ b/gm/degeneratesegments.cpp
@@ -302,7 +302,7 @@ protected:
20 * SK_Scalar1,
titlePaint);
- SkLCGRandom rand;
+ SkRandom rand;
SkRect rect = SkRect::MakeWH(220*SK_Scalar1, 50*SK_Scalar1);
canvas->save();
canvas->translate(2*SK_Scalar1, 30 * SK_Scalar1); // The title
diff --git a/gm/emptypath.cpp b/gm/emptypath.cpp
index 87e1cc554e..3b6fe8108f 100644
--- a/gm/emptypath.cpp
+++ b/gm/emptypath.cpp
@@ -73,7 +73,7 @@ protected:
20 * SK_Scalar1,
titlePaint);
- SkLCGRandom rand;
+ SkRandom rand;
SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1);
int i = 0;
canvas->save();
diff --git a/gm/getpostextpath.cpp b/gm/getpostextpath.cpp
index a411520258..45701071bb 100644
--- a/gm/getpostextpath.cpp
+++ b/gm/getpostextpath.cpp
@@ -56,7 +56,7 @@ protected:
SkAutoTArray<SkScalar> widths(len);
paint.getTextWidths(text, len, &widths[0]);
- SkLCGRandom rand;
+ SkRandom rand;
SkScalar x = SkIntToScalar(20);
SkScalar y = SkIntToScalar(100);
for (int i = 0; i < len; ++i) {
diff --git a/gm/hittestpath.cpp b/gm/hittestpath.cpp
index d971db9282..caed98fc95 100644
--- a/gm/hittestpath.cpp
+++ b/gm/hittestpath.cpp
@@ -46,7 +46,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
SkPath path;
- SkLCGRandom rand;
+ SkRandom rand;
int scale = 300;
for (int i = 0; i < 4; ++i) {
diff --git a/gm/linepaths.cpp b/gm/linepaths.cpp
index 53a9327878..05900c758e 100644
--- a/gm/linepaths.cpp
+++ b/gm/linepaths.cpp
@@ -95,7 +95,7 @@ protected:
20 * SK_Scalar1,
titlePaint);
- SkLCGRandom rand;
+ SkRandom rand;
SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1);
canvas->save();
canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1);
@@ -239,7 +239,7 @@ protected:
20 * SK_Scalar1,
titlePaint);
- SkLCGRandom rand;
+ SkRandom rand;
SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1);
canvas->save();
canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1);
diff --git a/gm/points.cpp b/gm/points.cpp
index 793e2e8f4f..b241fe019e 100644
--- a/gm/points.cpp
+++ b/gm/points.cpp
@@ -27,7 +27,7 @@ protected:
return SkISize::Make(640, 490);
}
- static void fill_pts(SkPoint pts[], size_t n, SkLCGRandom* rand) {
+ static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) {
for (size_t i = 0; i < n; i++) {
// Compute these independently and store in variables, rather
// than in the parameter-passing expression, to get consistent
@@ -41,7 +41,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
canvas->translate(SK_Scalar1, SK_Scalar1);
- SkLCGRandom rand;
+ SkRandom rand;
SkPaint p0, p1, p2, p3;
const size_t n = 99;
diff --git a/gm/polygons.cpp b/gm/polygons.cpp
index 56b2e97ceb..1d639780fd 100644
--- a/gm/polygons.cpp
+++ b/gm/polygons.cpp
@@ -88,7 +88,7 @@ protected:
canvas->translate(x, y);
}
- static void SetColorAndAlpha(SkPaint* paint, SkLCGRandom* rand) {
+ static void SetColorAndAlpha(SkPaint* paint, SkRandom* rand) {
SkColor color = rand->nextU();
color |= 0xff000000;
paint->setColor(color);
@@ -113,7 +113,7 @@ protected:
SkPaint paint;
paint.setAntiAlias(true);
- SkLCGRandom rand;
+ SkRandom rand;
// For stroke style painter
paint.setStyle(SkPaint::kStroke_Style);
for (int join = 0; join < kNumJoins; ++join) {
diff --git a/gm/quadpaths.cpp b/gm/quadpaths.cpp
index f2c4cf1fc8..1dbb3d090c 100644
--- a/gm/quadpaths.cpp
+++ b/gm/quadpaths.cpp
@@ -96,7 +96,7 @@ protected:
20 * SK_Scalar1,
titlePaint);
- SkLCGRandom rand;
+ SkRandom rand;
SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1);
canvas->save();
canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1);
@@ -245,7 +245,7 @@ protected:
20 * SK_Scalar1,
titlePaint);
- SkLCGRandom rand;
+ SkRandom rand;
SkRect rect = SkRect::MakeWH(100*SK_Scalar1, 30*SK_Scalar1);
canvas->save();
canvas->translate(10 * SK_Scalar1, 30 * SK_Scalar1);
diff --git a/gm/strokerects.cpp b/gm/strokerects.cpp
index f3445cc35d..65eadd1a90 100644
--- a/gm/strokerects.cpp
+++ b/gm/strokerects.cpp
@@ -37,7 +37,7 @@ protected:
return SkISize::Make(W*2, H*2);
}
- static void rnd_rect(SkRect* r, SkLCGRandom& rand) {
+ static void rnd_rect(SkRect* r, SkRandom& rand) {
SkScalar x = rand.nextUScalar1() * W;
SkScalar y = rand.nextUScalar1() * H;
SkScalar w = rand.nextUScalar1() * (W >> 2);
@@ -65,7 +65,7 @@ protected:
, SW - SkIntToScalar(2), SH - SkIntToScalar(2)
));
- SkLCGRandom rand;
+ SkRandom rand;
for (int i = 0; i < N; i++) {
SkRect r;
rnd_rect(&r, rand);
diff --git a/gm/strokes.cpp b/gm/strokes.cpp
index 81741693cf..2a92c031ae 100644
--- a/gm/strokes.cpp
+++ b/gm/strokes.cpp
@@ -18,7 +18,7 @@
static const SkScalar SW = SkIntToScalar(W);
static const SkScalar SH = SkIntToScalar(H);
-static void rnd_rect(SkRect* r, SkPaint* paint, SkLCGRandom& rand) {
+static void rnd_rect(SkRect* r, SkPaint* paint, SkRandom& rand) {
SkScalar x = rand.nextUScalar1() * W;
SkScalar y = rand.nextUScalar1() * H;
SkScalar w = rand.nextUScalar1() * (W >> 2);
@@ -65,7 +65,7 @@ protected:
, SW - SkIntToScalar(2), SH - SkIntToScalar(2)
));
- SkLCGRandom rand;
+ SkRandom rand;
for (int i = 0; i < N; i++) {
SkRect r;
rnd_rect(&r, &paint, rand);
@@ -85,7 +85,7 @@ class Strokes2GM : public skiagm::GM {
SkPath fPath;
public:
Strokes2GM() {
- SkLCGRandom rand;
+ SkRandom rand;
fPath.moveTo(0, 0);
for (int i = 0; i < 13; i++) {
SkScalar x = rand.nextUScalar1() * (W >> 1);
@@ -129,7 +129,7 @@ protected:
SW - SkIntToScalar(2),
SH - SkIntToScalar(2)));
- SkLCGRandom rand;
+ SkRandom rand;
for (int i = 0; i < N/2; i++) {
SkRect r;
rnd_rect(&r, &paint, rand);
diff --git a/include/utils/SkRandom.h b/include/utils/SkRandom.h
index d083fc6b2f..aee2d7a0aa 100644
--- a/include/utils/SkRandom.h
+++ b/include/utils/SkRandom.h
@@ -10,145 +10,6 @@
#include "SkScalar.h"
-/** \class SkLCGRandom
-
- Utility class that implements pseudo random 32bit numbers using a fast
- linear equation. Unlike rand(), this class holds its own seed (initially
- set to 0), so that multiple instances can be used with no side-effects.
-*/
-class SkLCGRandom {
-public:
- SkLCGRandom() : fSeed(0) {}
- SkLCGRandom(uint32_t seed) : fSeed(seed) {}
-
- /** Return the next pseudo random number as an unsigned 32bit value.
- */
- uint32_t nextU() { uint32_t r = fSeed * kMul + kAdd; fSeed = r; return r; }
-
- /** Return the next pseudo random number as a signed 32bit value.
- */
- int32_t nextS() { return (int32_t)this->nextU(); }
-
- /** Return the next pseudo random number as an unsigned 16bit value.
- */
- U16CPU nextU16() { return this->nextU() >> 16; }
-
- /** Return the next pseudo random number as a signed 16bit value.
- */
- S16CPU nextS16() { return this->nextS() >> 16; }
-
- /**
- * Returns value [0...1) as a float
- */
- float nextF() {
- // const is 1 / (2^32 - 1)
- return (float)(this->nextU() * 2.32830644e-10);
- }
-
- /**
- * Returns value [min...max) as a float
- */
- float nextRangeF(float min, float max) {
- return min + this->nextF() * (max - min);
- }
-
- /** Return the next pseudo random number, as an unsigned value of
- at most bitCount bits.
- @param bitCount The maximum number of bits to be returned
- */
- uint32_t nextBits(unsigned bitCount) {
- SkASSERT(bitCount > 0 && bitCount <= 32);
- return this->nextU() >> (32 - bitCount);
- }
-
- /** Return the next pseudo random unsigned number, mapped to lie within
- [min, max] inclusive.
- */
- uint32_t nextRangeU(uint32_t min, uint32_t max) {
- SkASSERT(min <= max);
- uint32_t range = max - min + 1;
- if (0 == range) {
- return this->nextU();
- } else {
- return min + this->nextU() % range;
- }
- }
-
- /** Return the next pseudo random unsigned number, mapped to lie within
- [0, count).
- */
- uint32_t nextULessThan(uint32_t count) {
- SkASSERT(count > 0);
- return this->nextRangeU(0, count - 1);
- }
-
- /** Return the next pseudo random number expressed as an unsigned SkFixed
- in the range [0..SK_Fixed1).
- */
- SkFixed nextUFixed1() { return this->nextU() >> 16; }
-
- /** Return the next pseudo random number expressed as a signed SkFixed
- in the range (-SK_Fixed1..SK_Fixed1).
- */
- SkFixed nextSFixed1() { return this->nextS() >> 15; }
-
- /** Return the next pseudo random number expressed as a SkScalar
- in the range [0..SK_Scalar1).
- */
- SkScalar nextUScalar1() { return SkFixedToScalar(this->nextUFixed1()); }
-
- /** Return the next pseudo random number expressed as a SkScalar
- in the range [min..max).
- */
- SkScalar nextRangeScalar(SkScalar min, SkScalar max) {
- return this->nextUScalar1() * (max - min) + min;
- }
-
- /** Return the next pseudo random number expressed as a SkScalar
- in the range (-SK_Scalar1..SK_Scalar1).
- */
- SkScalar nextSScalar1() { return SkFixedToScalar(this->nextSFixed1()); }
-
- /** Return the next pseudo random number as a bool.
- */
- bool nextBool() { return this->nextU() >= 0x80000000; }
-
- /** A biased version of nextBool().
- */
- bool nextBiasedBool(SkScalar fractionTrue) {
- SkASSERT(fractionTrue >= 0 && fractionTrue <= SK_Scalar1);
- return this->nextUScalar1() <= fractionTrue;
- }
-
- /**
- * Return the next pseudo random number as a signed 64bit value.
- */
- int64_t next64() {
- int64_t hi = this->nextS();
- return (hi << 32) | this->nextU();
- }
-
- /**
- * Return the current seed. This allows the caller to later reset to the
- * same seed (using setSeed) so it can generate the same sequence.
- */
- int32_t getSeed() const { return fSeed; }
-
- /** Set the seed of the random object. The seed is initialized to 0 when the
- object is first created, and is updated each time the next pseudo random
- number is requested.
- */
- void setSeed(int32_t seed) { fSeed = (uint32_t)seed; }
-
-private:
- // See "Numerical Recipes in C", 1992 page 284 for these constants
- enum {
- kMul = 1664525,
- kAdd = 1013904223
- };
- uint32_t fSeed;
-};
-
/** \class SkRandom
Utility class that implements pseudo random 32bit numbers using Marsaglia's
diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp
index 8aa0e22356..6765b296a5 100644
--- a/src/effects/SkDiscretePathEffect.cpp
+++ b/src/effects/SkDiscretePathEffect.cpp
@@ -11,7 +11,6 @@
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkPathMeasure.h"
-#include "SkRandom.h"
static void Perterb(SkPoint* p, const SkVector& tangent, SkScalar scale) {
SkVector normal = tangent;
@@ -27,6 +26,48 @@ SkDiscretePathEffect::SkDiscretePathEffect(SkScalar segLength,
{
}
+/** \class LCGRandom
+
+ Utility class that implements pseudo random 32bit numbers using a fast
+ linear equation. Unlike rand(), this class holds its own seed (initially
+ set to 0), so that multiple instances can be used with no side-effects.
+
+ Copied from the original implementation of SkRandom. Only contains the
+ methods used by SkDiscretePathEffect::filterPath, with methods that were
+ not called directly moved to private.
+*/
+
+class LCGRandom {
+public:
+ LCGRandom(uint32_t seed) : fSeed(seed) {}
+
+ /** Return the next pseudo random number expressed as a SkScalar
+ in the range (-SK_Scalar1..SK_Scalar1).
+ */
+ SkScalar nextSScalar1() { return SkFixedToScalar(this->nextSFixed1()); }
+
+private:
+ /** Return the next pseudo random number as an unsigned 32bit value.
+ */
+ uint32_t nextU() { uint32_t r = fSeed * kMul + kAdd; fSeed = r; return r; }
+
+ /** Return the next pseudo random number as a signed 32bit value.
+ */
+ int32_t nextS() { return (int32_t)this->nextU(); }
+
+ /** Return the next pseudo random number expressed as a signed SkFixed
+ in the range (-SK_Fixed1..SK_Fixed1).
+ */
+ SkFixed nextSFixed1() { return this->nextS() >> 15; }
+
+ // See "Numerical Recipes in C", 1992 page 284 for these constants
+ enum {
+ kMul = 1664525,
+ kAdd = 1013904223
+ };
+ uint32_t fSeed;
+};
+
bool SkDiscretePathEffect::filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec* rec, const SkRect*) const {
bool doFill = rec->isFillStyle();
@@ -36,10 +77,10 @@ bool SkDiscretePathEffect::filterPath(SkPath* dst, const SkPath& src,
/* Caller may supply their own seed assist, which by default is 0 */
uint32_t seed = fSeedAssist ^ SkScalarRoundToInt(meas.getLength());
- SkLCGRandom rand(seed ^ ((seed << 16) | (seed >> 16)));
- SkScalar scale = fPerterb;
- SkPoint p;
- SkVector v;
+ LCGRandom rand(seed ^ ((seed << 16) | (seed >> 16)));
+ SkScalar scale = fPerterb;
+ SkPoint p;
+ SkVector v;
do {
SkScalar length = meas.getLength();
diff --git a/tests/StrokerTest.cpp b/tests/StrokerTest.cpp
index 03e0624a0d..b588cc6d10 100755
--- a/tests/StrokerTest.cpp
+++ b/tests/StrokerTest.cpp
@@ -116,18 +116,18 @@ DEF_TEST(CubicStrokerSet, reporter) {
cubicPairSetTest(tests, tests_count);
}
-static SkScalar unbounded(SkLCGRandom& r) {
+static SkScalar unbounded(SkRandom& r) {
uint32_t val = r.nextU();
return SkBits2Float(val);
}
-static SkScalar unboundedPos(SkLCGRandom& r) {
+static SkScalar unboundedPos(SkRandom& r) {
uint32_t val = r.nextU() & 0x7fffffff;
return SkBits2Float(val);
}
DEF_TEST(QuadStrokerUnbounded, reporter) {
- SkLCGRandom r;
+ SkRandom r;
SkPaint p;
p.setStyle(SkPaint::kStroke_Style);
#if defined(SK_DEBUG) && QUAD_STROKE_APPROXIMATION
@@ -165,7 +165,7 @@ DEF_TEST(QuadStrokerUnbounded, reporter) {
}
DEF_TEST(CubicStrokerUnbounded, reporter) {
- SkLCGRandom r;
+ SkRandom r;
SkPaint p;
p.setStyle(SkPaint::kStroke_Style);
#if defined(SK_DEBUG) && QUAD_STROKE_APPROXIMATION
@@ -206,7 +206,7 @@ DEF_TEST(CubicStrokerUnbounded, reporter) {
}
DEF_TEST(QuadStrokerConstrained, reporter) {
- SkLCGRandom r;
+ SkRandom r;
SkPaint p;
p.setStyle(SkPaint::kStroke_Style);
#if defined(SK_DEBUG) && QUAD_STROKE_APPROXIMATION
@@ -257,7 +257,7 @@ DEF_TEST(QuadStrokerConstrained, reporter) {
}
DEF_TEST(CubicStrokerConstrained, reporter) {
- SkLCGRandom r;
+ SkRandom r;
SkPaint p;
p.setStyle(SkPaint::kStroke_Style);
#if defined(SK_DEBUG) && QUAD_STROKE_APPROXIMATION
@@ -316,7 +316,7 @@ DEF_TEST(CubicStrokerConstrained, reporter) {
}
DEF_TEST(QuadStrokerRange, reporter) {
- SkLCGRandom r;
+ SkRandom r;
SkPaint p;
p.setStyle(SkPaint::kStroke_Style);
#if defined(SK_DEBUG) && QUAD_STROKE_APPROXIMATION
@@ -361,7 +361,7 @@ DEF_TEST(QuadStrokerRange, reporter) {
}
DEF_TEST(CubicStrokerRange, reporter) {
- SkLCGRandom r;
+ SkRandom r;
SkPaint p;
p.setStyle(SkPaint::kStroke_Style);
#if defined(SK_DEBUG) && QUAD_STROKE_APPROXIMATION