OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkRTree_DEFINED | 9 #ifndef SkRTree_DEFINED |
10 #define SkRTree_DEFINED | 10 #define SkRTree_DEFINED |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 return this->isEmpty() ? 0 : fRoot.fChild.subtree->fLevel + 1; | 89 return this->isEmpty() ? 0 : fRoot.fChild.subtree->fLevel + 1; |
90 } | 90 } |
91 | 91 |
92 /** | 92 /** |
93 * This gets the insertion count (rather than the node count) | 93 * This gets the insertion count (rather than the node count) |
94 */ | 94 */ |
95 virtual int getCount() const SK_OVERRIDE { return fCount; } | 95 virtual int getCount() const SK_OVERRIDE { return fCount; } |
96 | 96 |
97 virtual void rewindInserts() SK_OVERRIDE; | 97 virtual void rewindInserts() SK_OVERRIDE; |
98 | 98 |
| 99 virtual size_t bytesUsed() const SK_OVERRIDE; |
| 100 |
99 private: | 101 private: |
100 | 102 |
101 struct Node; | 103 struct Node; |
102 | 104 |
103 /** | 105 /** |
104 * A branch of the tree, this may contain a pointer to another interior node
, or a data value | 106 * A branch of the tree, this may contain a pointer to another interior node
, or a data value |
105 */ | 107 */ |
106 struct Branch { | 108 struct Branch { |
107 union { | 109 union { |
108 Node* subtree; | 110 Node* subtree; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 SkTDArray<Branch> fDeferredInserts; | 194 SkTDArray<Branch> fDeferredInserts; |
193 SkScalar fAspectRatio; | 195 SkScalar fAspectRatio; |
194 bool fSortWhenBulkLoading; | 196 bool fSortWhenBulkLoading; |
195 | 197 |
196 Node* allocateNode(uint16_t level); | 198 Node* allocateNode(uint16_t level); |
197 | 199 |
198 typedef SkBBoxHierarchy INHERITED; | 200 typedef SkBBoxHierarchy INHERITED; |
199 }; | 201 }; |
200 | 202 |
201 #endif | 203 #endif |
OLD | NEW |