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

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

Issue 23480002: R-Tree -- Don't sort draw commands unless specified. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « bench/RTreeBench.cpp ('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 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
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 9
10 #include "SkPictureFlat.h" 10 #include "SkPictureFlat.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 226
227 SkBBoxHierarchy* SkPicture::createBBoxHierarchy() const { 227 SkBBoxHierarchy* SkPicture::createBBoxHierarchy() const {
228 // These values were empirically determined to produce reasonable 228 // These values were empirically determined to produce reasonable
229 // performance in most cases. 229 // performance in most cases.
230 static const int kRTreeMinChildren = 6; 230 static const int kRTreeMinChildren = 6;
231 static const int kRTreeMaxChildren = 11; 231 static const int kRTreeMaxChildren = 11;
232 232
233 SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(fWidth), 233 SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(fWidth),
234 SkIntToScalar(fHeight)); 234 SkIntToScalar(fHeight));
235 bool sortDraws = false; // Do not sort draw calls when bulk loading.
236
235 return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren, 237 return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren,
236 aspectRatio); 238 aspectRatio, sortDraws);
237 } 239 }
238 240
239 SkCanvas* SkPicture::getRecordingCanvas() const { 241 SkCanvas* SkPicture::getRecordingCanvas() const {
240 // will be null if we are not recording 242 // will be null if we are not recording
241 return fRecord; 243 return fRecord;
242 } 244 }
243 245
244 void SkPicture::endRecording() { 246 void SkPicture::endRecording() {
245 if (NULL == fPlayback) { 247 if (NULL == fPlayback) {
246 if (NULL != fRecord) { 248 if (NULL != fRecord) {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 348 }
347 349
348 #ifdef SK_BUILD_FOR_ANDROID 350 #ifdef SK_BUILD_FOR_ANDROID
349 void SkPicture::abortPlayback() { 351 void SkPicture::abortPlayback() {
350 if (NULL == fPlayback) { 352 if (NULL == fPlayback) {
351 return; 353 return;
352 } 354 }
353 fPlayback->abort(); 355 fPlayback->abort();
354 } 356 }
355 #endif 357 #endif
OLDNEW
« no previous file with comments | « bench/RTreeBench.cpp ('k') | src/core/SkRTree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698