Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: src/core/SkQuadTree.cpp

Issue 452233002: Make BBH::search() const. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More const for tile() Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkQuadTree.h ('k') | src/core/SkRTree.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "SkQuadTree.h" 8 #include "SkQuadTree.h"
9 #include "SkTSort.h" 9 #include "SkTSort.h"
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 Entry* entry = fEntryPool.acquire(); 161 Entry* entry = fEntryPool.acquire();
162 entry->fData = data; 162 entry->fData = data;
163 entry->fBounds = bounds; 163 entry->fBounds = bounds;
164 if (NULL == fRoot) { 164 if (NULL == fRoot) {
165 fDeferred.push(entry); 165 fDeferred.push(entry);
166 } else { 166 } else {
167 this->insert(fRoot, entry); 167 this->insert(fRoot, entry);
168 } 168 }
169 } 169 }
170 170
171 void SkQuadTree::search(const SkIRect& query, SkTDArray<void*>* results) { 171 void SkQuadTree::search(const SkIRect& query, SkTDArray<void*>* results) const {
172 SkASSERT(NULL != fRoot); 172 SkASSERT(NULL != fRoot);
173 SkASSERT(NULL != results); 173 SkASSERT(NULL != results);
174 if (SkIRect::Intersects(fRootBounds, query)) { 174 if (SkIRect::Intersects(fRootBounds, query)) {
175 this->search(fRoot, query, results); 175 this->search(fRoot, query, results);
176 } 176 }
177 } 177 }
178 178
179 void SkQuadTree::clear() { 179 void SkQuadTree::clear() {
180 this->flushDeferredInserts(); 180 this->flushDeferredInserts();
181 if (NULL != fRoot) { 181 if (NULL != fRoot) {
(...skipping 28 matching lines...) Expand all
210 210
211 void SkQuadTree::flushDeferredInserts() { 211 void SkQuadTree::flushDeferredInserts() {
212 if (NULL == fRoot) { 212 if (NULL == fRoot) {
213 fRoot = fNodePool.acquire(); 213 fRoot = fNodePool.acquire();
214 fRoot->fBounds = fRootBounds; 214 fRoot->fBounds = fRootBounds;
215 } 215 }
216 while(!fDeferred.isEmpty()) { 216 while(!fDeferred.isEmpty()) {
217 this->insert(fRoot, fDeferred.pop()); 217 this->insert(fRoot, fDeferred.pop());
218 } 218 }
219 } 219 }
OLDNEW
« no previous file with comments | « src/core/SkQuadTree.h ('k') | src/core/SkRTree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698