| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 tree->unref(); | 246 tree->unref(); |
| 247 } else { | 247 } else { |
| 248 fRecord = SkNEW_ARGS(SkPictureRecord, (size, recordingFlags)); | 248 fRecord = SkNEW_ARGS(SkPictureRecord, (size, recordingFlags)); |
| 249 } | 249 } |
| 250 fRecord->beginRecording(); | 250 fRecord->beginRecording(); |
| 251 | 251 |
| 252 return fRecord; | 252 return fRecord; |
| 253 } | 253 } |
| 254 | 254 |
| 255 SkBBoxHierarchy* SkPicture::createBBoxHierarchy() const { | 255 SkBBoxHierarchy* SkPicture::createBBoxHierarchy() const { |
| 256 // TODO: this code is now replicated in SkRTreePicture. Once all external |
| 257 // clients have been weaned off of kOptimizeForClippedPlayback_RecordingFlag
, |
| 258 // this code can be removed. |
| 259 |
| 256 // These values were empirically determined to produce reasonable | 260 // These values were empirically determined to produce reasonable |
| 257 // performance in most cases. | 261 // performance in most cases. |
| 258 static const int kRTreeMinChildren = 6; | 262 static const int kRTreeMinChildren = 6; |
| 259 static const int kRTreeMaxChildren = 11; | 263 static const int kRTreeMaxChildren = 11; |
| 260 | 264 |
| 261 SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(fWidth), | 265 SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(fWidth), |
| 262 SkIntToScalar(fHeight)); | 266 SkIntToScalar(fHeight)); |
| 263 bool sortDraws = false; // Do not sort draw calls when bulk loading. | 267 bool sortDraws = false; // Do not sort draw calls when bulk loading. |
| 264 | 268 |
| 265 return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren, | 269 return SkRTree::Create(kRTreeMinChildren, kRTreeMaxChildren, |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 if (NULL != fRecord) { | 518 if (NULL != fRecord) { |
| 515 SkASSERT(NULL == fPlayback); | 519 SkASSERT(NULL == fPlayback); |
| 516 return SK_InvalidGenID; | 520 return SK_InvalidGenID; |
| 517 } | 521 } |
| 518 | 522 |
| 519 if (SK_InvalidGenID == fUniqueID) { | 523 if (SK_InvalidGenID == fUniqueID) { |
| 520 fUniqueID = next_picture_generation_id(); | 524 fUniqueID = next_picture_generation_id(); |
| 521 } | 525 } |
| 522 return fUniqueID; | 526 return fUniqueID; |
| 523 } | 527 } |
| OLD | NEW |