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

Side by Side Diff: tests/BBoxHierarchyTest.cpp

Issue 187233002: Fast implementation of QuadTree (Closed) Base URL: https://skia.googlesource.com/skia.git@bbh_select
Patch Set: Reveiw fixes, renaming Created 6 years, 9 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
« src/core/SkQuadTree.cpp ('K') | « src/core/SkQuadTree.cpp ('k') | no next file » | 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 "Test.h" 8 #include "Test.h"
9 #include "SkRandom.h" 9 #include "SkRandom.h"
10 #include "SkQuadTree.h" 10 #include "SkQuadTree.h"
11 #include "SkRTree.h" 11 #include "SkRTree.h"
12 #include "SkTSort.h" 12 #include "SkTSort.h"
13 13
14 static const size_t RTREE_MIN_CHILDREN = 6; 14 static const size_t RTREE_MIN_CHILDREN = 6;
15 static const size_t RTREE_MAX_CHILDREN = 11; 15 static const size_t RTREE_MAX_CHILDREN = 11;
16 static const size_t QUADTREE_MIN_CHILDREN = 4; 16 static const size_t QUADTREE_MIN_CHILDREN = 0;
17 static const size_t QUADTREE_MAX_CHILDREN = 0; // No hard limit for quadtree 17 static const size_t QUADTREE_MAX_CHILDREN = 0; // No hard limit for quadtree
18 18
19 static const int NUM_RECTS = 200; 19 static const int NUM_RECTS = 200;
20 static const size_t NUM_ITERATIONS = 100; 20 static const size_t NUM_ITERATIONS = 100;
21 static const size_t NUM_QUERIES = 50; 21 static const size_t NUM_QUERIES = 50;
22 22
23 static const int MAX_SIZE = 1000; 23 static const int MAX_SIZE = 1000;
24 24
25 struct DataRect { 25 struct DataRect {
26 SkIRect rect; 26 SkIRect rect;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 SkAutoUnref au(quadtree); 171 SkAutoUnref au(quadtree);
172 tree_test_main(quadtree, QUADTREE_MIN_CHILDREN, QUADTREE_MAX_CHILDREN, r eporter); 172 tree_test_main(quadtree, QUADTREE_MIN_CHILDREN, QUADTREE_MAX_CHILDREN, r eporter);
173 173
174 // QuadTree that orders input rectangles on deferred insert. 174 // QuadTree that orders input rectangles on deferred insert.
175 SkQuadTree* unsortedQuadTree = SkQuadTree::Create( 175 SkQuadTree* unsortedQuadTree = SkQuadTree::Create(
176 SkIRect::MakeLTRB(-MAX_SIZE, -MAX_SIZE, MAX_SIZE, MAX_SIZE)); 176 SkIRect::MakeLTRB(-MAX_SIZE, -MAX_SIZE, MAX_SIZE, MAX_SIZE));
177 SkAutoUnref auo(unsortedQuadTree); 177 SkAutoUnref auo(unsortedQuadTree);
178 tree_test_main(unsortedQuadTree, QUADTREE_MIN_CHILDREN, QUADTREE_MAX_CHI LDREN, reporter); 178 tree_test_main(unsortedQuadTree, QUADTREE_MIN_CHILDREN, QUADTREE_MAX_CHI LDREN, reporter);
179 } 179 }
180 } 180 }
OLDNEW
« src/core/SkQuadTree.cpp ('K') | « src/core/SkQuadTree.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698