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

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

Issue 1300163002: unsigned -> int for counts and indices in picture-related code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 5 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/SkRTree.h ('k') | src/core/SkRecord.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 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 ++currentBranch; 154 ++currentBranch;
155 } 155 }
156 (*branches)[newBranches] = b; 156 (*branches)[newBranches] = b;
157 ++newBranches; 157 ++newBranches;
158 } 158 }
159 } 159 }
160 branches->setCount(newBranches); 160 branches->setCount(newBranches);
161 return this->bulkLoad(branches, level + 1); 161 return this->bulkLoad(branches, level + 1);
162 } 162 }
163 163
164 void SkRTree::search(const SkRect& query, SkTDArray<unsigned>* results) const { 164 void SkRTree::search(const SkRect& query, SkTDArray<int>* results) const {
165 if (fCount > 0 && SkRect::Intersects(fRoot.fBounds, query)) { 165 if (fCount > 0 && SkRect::Intersects(fRoot.fBounds, query)) {
166 this->search(fRoot.fSubtree, query, results); 166 this->search(fRoot.fSubtree, query, results);
167 } 167 }
168 } 168 }
169 169
170 void SkRTree::search(Node* node, const SkRect& query, SkTDArray<unsigned>* resul ts) const { 170 void SkRTree::search(Node* node, const SkRect& query, SkTDArray<int>* results) c onst {
171 for (int i = 0; i < node->fNumChildren; ++i) { 171 for (int i = 0; i < node->fNumChildren; ++i) {
172 if (SkRect::Intersects(node->fChildren[i].fBounds, query)) { 172 if (SkRect::Intersects(node->fChildren[i].fBounds, query)) {
173 if (0 == node->fLevel) { 173 if (0 == node->fLevel) {
174 results->push(node->fChildren[i].fOpIndex); 174 results->push(node->fChildren[i].fOpIndex);
175 } else { 175 } else {
176 this->search(node->fChildren[i].fSubtree, query, results); 176 this->search(node->fChildren[i].fSubtree, query, results);
177 } 177 }
178 } 178 }
179 } 179 }
180 } 180 }
181 181
182 size_t SkRTree::bytesUsed() const { 182 size_t SkRTree::bytesUsed() const {
183 size_t byteCount = sizeof(SkRTree); 183 size_t byteCount = sizeof(SkRTree);
184 184
185 byteCount += fNodes.reserved() * sizeof(Node); 185 byteCount += fNodes.reserved() * sizeof(Node);
186 186
187 return byteCount; 187 return byteCount;
188 } 188 }
OLDNEW
« no previous file with comments | « src/core/SkRTree.h ('k') | src/core/SkRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698