OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef SkQuadTree_DEFINED | 8 #ifndef SkQuadTree_DEFINED |
9 #define SkQuadTree_DEFINED | 9 #define SkQuadTree_DEFINED |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 | 65 |
66 /** | 66 /** |
67 * This gets the insertion count (rather than the node count) | 67 * This gets the insertion count (rather than the node count) |
68 */ | 68 */ |
69 virtual int getCount() const SK_OVERRIDE { | 69 virtual int getCount() const SK_OVERRIDE { |
70 return fEntryPool.allocated() - fEntryPool.available(); | 70 return fEntryPool.allocated() - fEntryPool.available(); |
71 } | 71 } |
72 | 72 |
73 virtual void rewindInserts() SK_OVERRIDE; | 73 virtual void rewindInserts() SK_OVERRIDE; |
74 | 74 |
75 virtual size_t bytesUsed() const SK_OVERRIDE; | |
mtklein
2014/11/17 20:19:31
No more quad tree.
| |
76 | |
75 private: | 77 private: |
76 struct Entry { | 78 struct Entry { |
77 Entry() : fData(NULL) {} | 79 Entry() : fData(NULL) {} |
78 SkIRect fBounds; | 80 SkIRect fBounds; |
79 void* fData; | 81 void* fData; |
80 SK_DECLARE_INTERNAL_SLIST_INTERFACE(Entry); | 82 SK_DECLARE_INTERNAL_SLIST_INTERFACE(Entry); |
81 }; | 83 }; |
82 | 84 |
83 static const int kChildCount = 4; | 85 static const int kChildCount = 4; |
84 | 86 |
(...skipping 19 matching lines...) Expand all Loading... | |
104 void insert(Node* node, Entry* entry); | 106 void insert(Node* node, Entry* entry); |
105 void split(Node* node); | 107 void split(Node* node); |
106 void search(Node* node, const SkIRect& query, SkTDArray<void*>* results) con st; | 108 void search(Node* node, const SkIRect& query, SkTDArray<void*>* results) con st; |
107 void clear(Node* node); | 109 void clear(Node* node); |
108 int getDepth(Node* node) const; | 110 int getDepth(Node* node) const; |
109 | 111 |
110 typedef SkBBoxHierarchy INHERITED; | 112 typedef SkBBoxHierarchy INHERITED; |
111 }; | 113 }; |
112 | 114 |
113 #endif | 115 #endif |
OLD | NEW |