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

Unified Diff: cc/base/rtree.cc

Issue 2881063003: cc: Change RTree::Search to return results, add comments, more tests. (Closed)
Patch Set: update Created 3 years, 7 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 | « cc/base/rtree.h ('k') | cc/base/rtree_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/rtree.cc
diff --git a/cc/base/rtree.cc b/cc/base/rtree.cc
index ab4b128b52b78332f5c9bb2065975c823daa1115..0859fcc3d13813f5d7e1c10502f8923e7e50e626 100644
--- a/cc/base/rtree.cc
+++ b/cc/base/rtree.cc
@@ -109,9 +109,11 @@ RTree::Branch RTree::BuildRecursive(std::vector<Branch>* branches, int level) {
return BuildRecursive(branches, level + 1);
}
-void RTree::Search(const gfx::Rect& query, std::vector<size_t>* results) const {
+std::vector<size_t> RTree::Search(const gfx::Rect& query) const {
+ std::vector<size_t> results;
if (num_data_elements_ > 0 && query.Intersects(root_.bounds))
- SearchRecursive(root_.subtree, query, results);
+ SearchRecursive(root_.subtree, query, &results);
+ return results;
}
void RTree::SearchRecursive(Node* node,
« no previous file with comments | « cc/base/rtree.h ('k') | cc/base/rtree_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698