| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 virtual ~SkRTree(); | 60 virtual ~SkRTree(); |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * Insert a node, consisting of bounds and a data value into the tree, if we
don't immediately | 63 * Insert a node, consisting of bounds and a data value into the tree, if we
don't immediately |
| 64 * need to use the tree; we may allow the insert to be deferred (this can al
low us to bulk-load | 64 * need to use the tree; we may allow the insert to be deferred (this can al
low us to bulk-load |
| 65 * a large batch of nodes at once, which tends to be faster and produce a be
tter tree). | 65 * a large batch of nodes at once, which tends to be faster and produce a be
tter tree). |
| 66 * @param data The data value | 66 * @param data The data value |
| 67 * @param bounds The corresponding bounding box | 67 * @param bounds The corresponding bounding box |
| 68 * @param defer Can this insert be deferred? (this may be ignored) | 68 * @param defer Can this insert be deferred? (this may be ignored) |
| 69 */ | 69 */ |
| 70 virtual void insert(void* data, const SkRect& bounds, bool defer = false) SK
_OVERRIDE; | 70 virtual void insert(void* data, const SkIRect& bounds, bool defer = false) S
K_OVERRIDE; |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * If any inserts have been deferred, this will add them into the tree | 73 * If any inserts have been deferred, this will add them into the tree |
| 74 */ | 74 */ |
| 75 virtual void flushDeferredInserts() SK_OVERRIDE; | 75 virtual void flushDeferredInserts() SK_OVERRIDE; |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * Given a query rectangle, populates the passed-in array with the elements
it intersects | 78 * Given a query rectangle, populates the passed-in array with the elements
it intersects |
| 79 */ | 79 */ |
| 80 virtual void search(const SkRect& query, SkTDArray<void*>* results) const SK
_OVERRIDE; | 80 virtual void search(const SkIRect& query, SkTDArray<void*>* results) const S
K_OVERRIDE; |
| 81 | 81 |
| 82 virtual void clear() SK_OVERRIDE; | 82 virtual void clear() SK_OVERRIDE; |
| 83 bool isEmpty() const { return 0 == fCount; } | 83 bool isEmpty() const { return 0 == fCount; } |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * Gets the depth of the tree structure | 86 * Gets the depth of the tree structure |
| 87 */ | 87 */ |
| 88 virtual int getDepth() const SK_OVERRIDE { | 88 virtual int getDepth() const SK_OVERRIDE { |
| 89 return this->isEmpty() ? 0 : fRoot.fChild.subtree->fLevel + 1; | 89 return this->isEmpty() ? 0 : fRoot.fChild.subtree->fLevel + 1; |
| 90 } | 90 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 SkTDArray<Branch> fDeferredInserts; | 192 SkTDArray<Branch> fDeferredInserts; |
| 193 SkScalar fAspectRatio; | 193 SkScalar fAspectRatio; |
| 194 bool fSortWhenBulkLoading; | 194 bool fSortWhenBulkLoading; |
| 195 | 195 |
| 196 Node* allocateNode(uint16_t level); | 196 Node* allocateNode(uint16_t level); |
| 197 | 197 |
| 198 typedef SkBBoxHierarchy INHERITED; | 198 typedef SkBBoxHierarchy INHERITED; |
| 199 }; | 199 }; |
| 200 | 200 |
| 201 #endif | 201 #endif |
| OLD | NEW |