| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |