Go to the source code of this file.
◆ DEF_TEST()
Definition at line 65 of file RTreeTest.cpp.
65 {
66 int expectedDepthMin = -1;
68 while (tmp > 0) {
70 static_cast<double>(expectedDepthMin + 1)));
71 ++expectedDepthMin;
72 }
73
74 int expectedDepthMax = -1;
76 while (tmp > 0) {
78 static_cast<double>(expectedDepthMax + 1)));
79 ++expectedDepthMax;
80 }
81
87
90 }
91
93
97 expectedDepthMax >= rtree.
getDepth());
98 }
99}
static SkRect random_rect(SkRandom &rand)
static const int NUM_RECTS
static void run_queries(skiatest::Reporter *reporter, SkRandom &rand, SkRect rects[], const SkRTree &tree)
static const size_t NUM_ITERATIONS
#define REPORTER_ASSERT(r, cond,...)
void insert(const SkRect[], int N) override
static const int kMinChildren
static const int kMaxChildren
◆ random_rect()
Definition at line 25 of file RTreeTest.cpp.
25 {
27 while (
rect.isEmpty()) {
33 }
35}
float nextRangeF(float min, float max)
sk_sp< SkBlender > blender SkRect rect
◆ run_queries()
Definition at line 55 of file RTreeTest.cpp.
56 {
58 std::vector<int> hits;
62 }
63}
static const size_t NUM_QUERIES
static bool verify_query(SkRect query, SkRect rects[], const std::vector< int > &found)
void search(const SkRect &query, std::vector< int > *results) const override
◆ verify_query()
static bool verify_query |
( |
SkRect |
query, |
|
|
SkRect |
rects[], |
|
|
const std::vector< int > & |
found |
|
) |
| |
|
static |
Definition at line 37 of file RTreeTest.cpp.
37 {
38 std::vector<int> expected;
39
41 if (SkRect::Intersects(query, rects[
i])) {
42 expected.push_back(
i);
43 }
44 }
45
46 if (expected.size() != found.size()) {
47 return false;
48 }
49 if (0 == expected.size()) {
50 return true;
51 }
52 return found == expected;
53}
◆ NUM_ITERATIONS
const size_t NUM_ITERATIONS = 100 |
|
static |
◆ NUM_QUERIES
const size_t NUM_QUERIES = 50 |
|
static |
◆ NUM_RECTS
const int NUM_RECTS = 200 |
|
static |