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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 virtual void clear(); | 81 virtual void clear(); |
82 bool isEmpty() const { return 0 == fCount; } | 82 bool isEmpty() const { return 0 == fCount; } |
83 int getDepth() const { return this->isEmpty() ? 0 : fRoot.fChild.subtree->fL
evel + 1; } | 83 int getDepth() const { return this->isEmpty() ? 0 : fRoot.fChild.subtree->fL
evel + 1; } |
84 | 84 |
85 /** | 85 /** |
86 * This gets the insertion count (rather than the node count) | 86 * This gets the insertion count (rather than the node count) |
87 */ | 87 */ |
88 virtual int getCount() const { return fCount; } | 88 virtual int getCount() const { return fCount; } |
89 | 89 |
| 90 virtual void rewindInserts() SK_OVERRIDE; |
| 91 |
90 private: | 92 private: |
91 | 93 |
92 struct Node; | 94 struct Node; |
93 | 95 |
94 /** | 96 /** |
95 * A branch of the tree, this may contain a pointer to another interior node
, or a data value | 97 * A branch of the tree, this may contain a pointer to another interior node
, or a data value |
96 */ | 98 */ |
97 struct Branch { | 99 struct Branch { |
98 union { | 100 union { |
99 Node* subtree; | 101 Node* subtree; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 SkChunkAlloc fNodes; | 184 SkChunkAlloc fNodes; |
183 SkTDArray<Branch> fDeferredInserts; | 185 SkTDArray<Branch> fDeferredInserts; |
184 SkScalar fAspectRatio; | 186 SkScalar fAspectRatio; |
185 | 187 |
186 Node* allocateNode(uint16_t level); | 188 Node* allocateNode(uint16_t level); |
187 | 189 |
188 typedef SkBBoxHierarchy INHERITED; | 190 typedef SkBBoxHierarchy INHERITED; |
189 }; | 191 }; |
190 | 192 |
191 #endif | 193 #endif |
OLD | NEW |