| 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 SkBBoxHierarchy_DEFINED | 9 #ifndef SkBBoxHierarchy_DEFINED |
| 10 #define SkBBoxHierarchy_DEFINED | 10 #define SkBBoxHierarchy_DEFINED |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 /** | 43 /** |
| 44 * Insert a data pointer and corresponding bounding box | 44 * Insert a data pointer and corresponding bounding box |
| 45 * @param data The data pointer, may be NULL | 45 * @param data The data pointer, may be NULL |
| 46 * @param bounds The bounding box, should not be empty | 46 * @param bounds The bounding box, should not be empty |
| 47 * @param defer Whether or not it is acceptable to delay insertion of this e
lement (building up | 47 * @param defer Whether or not it is acceptable to delay insertion of this e
lement (building up |
| 48 * an entire spatial data structure at once is often faster and produ
ces better | 48 * an entire spatial data structure at once is often faster and produ
ces better |
| 49 * structures than repeated inserts) until flushDeferredInserts is ca
lled or the first | 49 * structures than repeated inserts) until flushDeferredInserts is ca
lled or the first |
| 50 * search. | 50 * search. |
| 51 */ | 51 */ |
| 52 virtual void insert(void* data, const SkIRect& bounds, bool defer = false) =
0; | 52 virtual void insert(void* data, const SkRect& bounds, bool defer = false) =
0; |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * If any insertions have been deferred, this forces them to be inserted | 55 * If any insertions have been deferred, this forces them to be inserted |
| 56 */ | 56 */ |
| 57 virtual void flushDeferredInserts() = 0; | 57 virtual void flushDeferredInserts() = 0; |
| 58 | 58 |
| 59 /** | 59 /** |
| 60 * Populate 'results' with data pointers corresponding to bounding boxes tha
t intersect 'query' | 60 * Populate 'results' with data pointers corresponding to bounding boxes tha
t intersect 'query' |
| 61 */ | 61 */ |
| 62 virtual void search(const SkIRect& query, SkTDArray<void*>* results) const =
0; | 62 virtual void search(const SkRect& query, SkTDArray<void*>* results) const =
0; |
| 63 | 63 |
| 64 virtual void clear() = 0; | 64 virtual void clear() = 0; |
| 65 | 65 |
| 66 /** | 66 /** |
| 67 * Gets the number of insertions actually made (does not include deferred in
sertions) | 67 * Gets the number of insertions actually made (does not include deferred in
sertions) |
| 68 */ | 68 */ |
| 69 virtual int getCount() const = 0; | 69 virtual int getCount() const = 0; |
| 70 | 70 |
| 71 /** | 71 /** |
| 72 * Returns the depth of the currently allocated tree. The root node counts f
or 1 level, | 72 * Returns the depth of the currently allocated tree. The root node counts f
or 1 level, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 89 void setClient(SkBBoxHierarchyClient* client) { fClient = client; } | 89 void setClient(SkBBoxHierarchyClient* client) { fClient = client; } |
| 90 | 90 |
| 91 protected: | 91 protected: |
| 92 SkBBoxHierarchyClient* fClient; | 92 SkBBoxHierarchyClient* fClient; |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 typedef SkRefCnt INHERITED; | 95 typedef SkRefCnt INHERITED; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 #endif | 98 #endif |
| OLD | NEW |