OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #include "SkRTree.h" | 8 #include "SkRTree.h" |
9 | 9 |
10 SkRTree::SkRTree(SkScalar aspectRatio) : fCount(0), fAspectRatio(aspectRatio) {} | 10 SkRTree::SkRTree(SkScalar aspectRatio) : fCount(0), fAspectRatio(aspectRatio) {} |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 for (int i = 0; i < node->fNumChildren; ++i) { | 163 for (int i = 0; i < node->fNumChildren; ++i) { |
164 if (SkRect::Intersects(node->fChildren[i].fBounds, query)) { | 164 if (SkRect::Intersects(node->fChildren[i].fBounds, query)) { |
165 if (0 == node->fLevel) { | 165 if (0 == node->fLevel) { |
166 results->push(node->fChildren[i].fOpIndex); | 166 results->push(node->fChildren[i].fOpIndex); |
167 } else { | 167 } else { |
168 this->search(node->fChildren[i].fSubtree, query, results); | 168 this->search(node->fChildren[i].fSubtree, query, results); |
169 } | 169 } |
170 } | 170 } |
171 } | 171 } |
172 } | 172 } |
| 173 |
| 174 size_t SkRTree::bytesUsed() const { |
| 175 size_t byteCount = sizeof(SkRTree); |
| 176 |
| 177 byteCount += fNodes.reserved() * sizeof(Node); |
| 178 |
| 179 return byteCount; |
| 180 } |
OLD | NEW |