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

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

Issue 977413003: Revert of Update SkPicture cull rects with RTree information (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/SkRecordDraw.cpp » ('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) {}
11 11
12 SkRect SkRTree::getRootBound() const {
13 if (fCount) {
14 return fRoot.fBounds;
15 } else {
16 return SkRect::MakeEmpty();
17 }
18 }
19
20 void SkRTree::insert(const SkRect boundsArray[], int N) { 12 void SkRTree::insert(const SkRect boundsArray[], int N) {
21 SkASSERT(0 == fCount); 13 SkASSERT(0 == fCount);
22 14
23 SkTDArray<Branch> branches; 15 SkTDArray<Branch> branches;
24 branches.setReserve(N); 16 branches.setReserve(N);
25 17
26 for (int i = 0; i < N; i++) { 18 for (int i = 0; i < N; i++) {
27 const SkRect& bounds = boundsArray[i]; 19 const SkRect& bounds = boundsArray[i];
28 if (bounds.isEmpty()) { 20 if (bounds.isEmpty()) {
29 continue; 21 continue;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 171 }
180 } 172 }
181 173
182 size_t SkRTree::bytesUsed() const { 174 size_t SkRTree::bytesUsed() const {
183 size_t byteCount = sizeof(SkRTree); 175 size_t byteCount = sizeof(SkRTree);
184 176
185 byteCount += fNodes.reserved() * sizeof(Node); 177 byteCount += fNodes.reserved() * sizeof(Node);
186 178
187 return byteCount; 179 return byteCount;
188 } 180 }
OLDNEW
« no previous file with comments | « src/core/SkRTree.h ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698