| 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 633 |
| 634 // fRecord OK | 634 // fRecord OK |
| 635 uint32_t SkPicture::uniqueID() const { | 635 uint32_t SkPicture::uniqueID() const { |
| 636 if (SK_InvalidGenID == fUniqueID) { | 636 if (SK_InvalidGenID == fUniqueID) { |
| 637 fUniqueID = next_picture_generation_id(); | 637 fUniqueID = next_picture_generation_id(); |
| 638 } | 638 } |
| 639 return fUniqueID; | 639 return fUniqueID; |
| 640 } | 640 } |
| 641 | 641 |
| 642 static SkRecord* optimized(SkRecord* r) { | 642 static SkRecord* optimized(SkRecord* r) { |
| 643 SkRecordOptimize(r); | 643 // TODO(mtklein): try this after SkRecord has stuck |
| 644 //SkRecordOptimize(r); |
| 644 return r; | 645 return r; |
| 645 } | 646 } |
| 646 | 647 |
| 647 // fRecord OK | 648 // fRecord OK |
| 648 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi
erarchy* bbh) | 649 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi
erarchy* bbh) |
| 649 : fCullWidth(width) | 650 : fCullWidth(width) |
| 650 , fCullHeight(height) | 651 , fCullHeight(height) |
| 651 , fRecord(optimized(record)) | 652 , fRecord(optimized(record)) |
| 652 , fBBH(SkSafeRef(bbh)) | 653 , fBBH(SkSafeRef(bbh)) |
| 653 , fAnalysis(*fRecord) { | 654 , fAnalysis(*fRecord) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 680 int SkPicture::approximateOpCount() const { | 681 int SkPicture::approximateOpCount() const { |
| 681 SkASSERT(fRecord.get() || fData.get()); | 682 SkASSERT(fRecord.get() || fData.get()); |
| 682 if (fRecord.get()) { | 683 if (fRecord.get()) { |
| 683 return fRecord->count(); | 684 return fRecord->count(); |
| 684 } | 685 } |
| 685 if (fData.get()) { | 686 if (fData.get()) { |
| 686 return fData->opCount(); | 687 return fData->opCount(); |
| 687 } | 688 } |
| 688 return 0; | 689 return 0; |
| 689 } | 690 } |
| OLD | NEW |