Index: src/core/SkRTree.cpp |
diff --git a/src/core/SkRTree.cpp b/src/core/SkRTree.cpp |
index 17872badc398e34c1f46f3061f44100ddb468ace..4a081db26d957add05c3affabea927be9c95deab 100644 |
--- a/src/core/SkRTree.cpp |
+++ b/src/core/SkRTree.cpp |
@@ -44,7 +44,7 @@ SkRTree::~SkRTree() { |
this->clear(); |
} |
-void SkRTree::insert(void* data, const SkRect& fbounds, bool defer) { |
+void SkRTree::insert(unsigned opIndex, const SkRect& fbounds, bool defer) { |
SkIRect bounds; |
if (fbounds.isLargest()) { |
bounds.setLargest(); |
@@ -59,7 +59,7 @@ void SkRTree::insert(void* data, const SkRect& fbounds, bool defer) { |
} |
Branch newBranch; |
newBranch.fBounds = bounds; |
- newBranch.fChild.data = data; |
+ newBranch.fChild.opIndex = opIndex; |
if (this->isEmpty()) { |
// since a bulk-load into an existing tree is as of yet unimplemented (and arguably not |
// of vital importance right now), we only batch up inserts if the tree is empty. |
@@ -109,7 +109,7 @@ void SkRTree::flushDeferredInserts() { |
this->validate(); |
} |
-void SkRTree::search(const SkRect& fquery, SkTDArray<void*>* results) const { |
+void SkRTree::search(const SkRect& fquery, SkTDArray<unsigned>* results) const { |
SkIRect query; |
fquery.roundOut(&query); |
this->validate(); |
@@ -309,11 +309,11 @@ int SkRTree::distributeChildren(Branch* children) { |
return fMinChildren - 1 + k; |
} |
-void SkRTree::search(Node* root, const SkIRect query, SkTDArray<void*>* results) const { |
+void SkRTree::search(Node* root, const SkIRect query, SkTDArray<unsigned>* results) const { |
for (int i = 0; i < root->fNumChildren; ++i) { |
if (SkIRect::IntersectsNoEmptyCheck(root->child(i)->fBounds, query)) { |
if (root->isLeaf()) { |
- results->push(root->child(i)->fChild.data); |
+ results->push(root->child(i)->fChild.opIndex); |
} else { |
this->search(root->child(i)->fChild.subtree, query, results); |
} |
@@ -448,14 +448,6 @@ int SkRTree::validateSubtree(Node* root, SkIRect bounds, bool isRoot) const { |
} |
} |
-void SkRTree::rewindInserts() { |
- SkASSERT(this->isEmpty()); // Currently only supports deferred inserts |
- while (!fDeferredInserts.isEmpty() && |
- fClient->shouldRewind(fDeferredInserts.top().fChild.data)) { |
- fDeferredInserts.pop(); |
- } |
-} |
- |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
static inline uint32_t get_area(const SkIRect& rect) { |