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

Side by Side Diff: tests/RTreeTest.cpp

Issue 913833002: Simplify SkBBH::insert API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « tests/PictureTest.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkRTree.h" 8 #include "SkRTree.h"
9 #include "SkRandom.h" 9 #include "SkRandom.h"
10 #include "Test.h" 10 #include "Test.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 SkRandom rand; 73 SkRandom rand;
74 SkAutoTMalloc<SkRect> rects(NUM_RECTS); 74 SkAutoTMalloc<SkRect> rects(NUM_RECTS);
75 for (size_t i = 0; i < NUM_ITERATIONS; ++i) { 75 for (size_t i = 0; i < NUM_ITERATIONS; ++i) {
76 SkRTree rtree; 76 SkRTree rtree;
77 REPORTER_ASSERT(reporter, 0 == rtree.getCount()); 77 REPORTER_ASSERT(reporter, 0 == rtree.getCount());
78 78
79 for (int j = 0; j < NUM_RECTS; j++) { 79 for (int j = 0; j < NUM_RECTS; j++) {
80 rects[j] = random_rect(rand); 80 rects[j] = random_rect(rand);
81 } 81 }
82 82
83 rtree.insert(&rects, NUM_RECTS); 83 rtree.insert(rects.get(), NUM_RECTS);
84 SkASSERT(rects); // SkRTree doesn't take ownership of rects. 84 SkASSERT(rects); // SkRTree doesn't take ownership of rects.
85 85
86 run_queries(reporter, rand, rects, rtree); 86 run_queries(reporter, rand, rects, rtree);
87 REPORTER_ASSERT(reporter, NUM_RECTS == rtree.getCount()); 87 REPORTER_ASSERT(reporter, NUM_RECTS == rtree.getCount());
88 REPORTER_ASSERT(reporter, expectedDepthMin <= rtree.getDepth() && 88 REPORTER_ASSERT(reporter, expectedDepthMin <= rtree.getDepth() &&
89 expectedDepthMax >= rtree.getDepth()); 89 expectedDepthMax >= rtree.getDepth());
90 } 90 }
91 } 91 }
OLDNEW
« no previous file with comments | « tests/PictureTest.cpp ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698