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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 } | 632 } |
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 |
642 static SkRecord* optimized(SkRecord* r) { | 643 static SkRecord* optimized(SkRecord* r) { |
643 // TODO(mtklein): try this after SkRecord has stuck | 644 #ifdef SK_PICTURE_OPTIMIZE_SK_RECORD |
644 //SkRecordOptimize(r); | 645 SkRecordOptimize(r); |
| 646 #endif |
645 return r; | 647 return r; |
646 } | 648 } |
647 | 649 |
648 // fRecord OK | 650 // fRecord OK |
649 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi
erarchy* bbh) | 651 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi
erarchy* bbh) |
650 : fCullWidth(width) | 652 : fCullWidth(width) |
651 , fCullHeight(height) | 653 , fCullHeight(height) |
652 , fRecord(optimized(record)) | 654 , fRecord(optimized(record)) |
653 , fBBH(SkSafeRef(bbh)) | 655 , fBBH(SkSafeRef(bbh)) |
654 , fAnalysis(*fRecord) { | 656 , fAnalysis(*fRecord) { |
(...skipping 26 matching lines...) Expand all Loading... |
681 int SkPicture::approximateOpCount() const { | 683 int SkPicture::approximateOpCount() const { |
682 SkASSERT(fRecord.get() || fData.get()); | 684 SkASSERT(fRecord.get() || fData.get()); |
683 if (fRecord.get()) { | 685 if (fRecord.get()) { |
684 return fRecord->count(); | 686 return fRecord->count(); |
685 } | 687 } |
686 if (fData.get()) { | 688 if (fData.get()) { |
687 return fData->opCount(); | 689 return fData->opCount(); |
688 } | 690 } |
689 return 0; | 691 return 0; |
690 } | 692 } |
OLD | NEW |