Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(828)

Unified Diff: tests/AAClipTest.cpp

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkPathUtils.cpp ('k') | tests/BitmapGetColorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/AAClipTest.cpp
diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp
index b50757038a6d31e376509bff770ff2f67c90d649..e3be006e575db727b0d8668b29d7f309f7be3ceb 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;
« no previous file with comments | « src/utils/SkPathUtils.cpp ('k') | tests/BitmapGetColorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698