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

Unified Diff: tests/RTreeTest.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 | « tests/PictureTest.cpp ('k') | tests/RegionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/RTreeTest.cpp
===================================================================
--- tests/RTreeTest.cpp (revision 7902)
+++ tests/RTreeTest.cpp (working copy)
@@ -23,7 +23,7 @@
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 @@
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 @@
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 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);
« no previous file with comments | « tests/PictureTest.cpp ('k') | tests/RegionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698