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