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

Unified Diff: tests/AAClipTest.cpp

Issue 12334131: Change random number generator for tests to SkMWCRandom (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Rebase to latest Created 7 years, 10 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/gpu/gl/GrGLEffectMatrix.h ('k') | tests/BlurTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/AAClipTest.cpp
===================================================================
--- tests/AAClipTest.cpp (revision 7902)
+++ tests/AAClipTest.cpp (working copy)
@@ -87,7 +87,7 @@
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 @@
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 @@
// 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 @@
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 test_irect(skiatest::Reporter* reporter) {
- SkRandom rand;
+ SkMWCRandom rand;
for (int i = 0; i < 10000; i++) {
SkAAClip clip0, clip1;
« no previous file with comments | « src/gpu/gl/GrGLEffectMatrix.h ('k') | tests/BlurTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698