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

Unified Diff: src/core/SkQuadTree.h

Issue 196383026: Slightly faster quadtree searching (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use U8CPU for intersection bitmask 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkQuadTree.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkQuadTree.h
diff --git a/src/core/SkQuadTree.h b/src/core/SkQuadTree.h
index a3b47bdba4ecc50521b8e03c9c59f5ebc39b85bd..bf1bc8ebbac3f6960be7b0a6243ca957952cdd1b 100644
--- a/src/core/SkQuadTree.h
+++ b/src/core/SkQuadTree.h
@@ -66,7 +66,9 @@ public:
/**
* This gets the insertion count (rather than the node count)
*/
- virtual int getCount() const SK_OVERRIDE { return fEntryCount; }
+ virtual int getCount() const SK_OVERRIDE {
+ return fEntryPool.allocated() - fEntryPool.available();
+ }
virtual void rewindInserts() SK_OVERRIDE;
@@ -95,12 +97,12 @@ private:
SkTObjectPool<Entry> fEntryPool;
SkTObjectPool<Node> fNodePool;
- int fEntryCount;
Node* fRoot;
+ SkIRect fRootBounds;
SkTInternalSList<Entry> fDeferred;
- Node* pickChild(Node* node, const SkIRect& bounds) const;
void insert(Node* node, Entry* entry);
+ void split(Node* node);
void search(Node* node, const SkIRect& query, SkTDArray<void*>* results) const;
void clear(Node* node);
int getDepth(Node* node) const;
« no previous file with comments | « no previous file | src/core/SkQuadTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698