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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 if (fRecord.get()) { | 557 if (fRecord.get()) { |
558 return fAnalysis.fHasText; | 558 return fAnalysis.fHasText; |
559 } | 559 } |
560 if (fData.get()) { | 560 if (fData.get()) { |
561 return fData->hasText(); | 561 return fData->hasText(); |
562 } | 562 } |
563 SkFAIL("Unreachable"); | 563 SkFAIL("Unreachable"); |
564 return false; | 564 return false; |
565 } | 565 } |
566 | 566 |
| 567 size_t SkPicture::bytesUsed() const { |
| 568 size_t byteCount = sizeof(SkPicture); |
| 569 |
| 570 // No support for old SkPicture backend |
| 571 if (!fRecord.get()) { |
| 572 return 0; |
| 573 } |
| 574 |
| 575 byteCount += fRecord->bytesUsed(); |
| 576 if (fBBH.get()) { |
| 577 byteCount += fBBH->bytesUsed(); |
| 578 } |
| 579 return byteCount; |
| 580 } |
| 581 |
| 582 |
567 // fRecord OK | 583 // fRecord OK |
568 bool SkPicture::willPlayBackBitmaps() const { | 584 bool SkPicture::willPlayBackBitmaps() const { |
569 if (fRecord.get()) { | 585 if (fRecord.get()) { |
570 return fAnalysis.fWillPlaybackBitmaps; | 586 return fAnalysis.fWillPlaybackBitmaps; |
571 } | 587 } |
572 if (fData.get()) { | 588 if (fData.get()) { |
573 return fData->containsBitmaps(); | 589 return fData->containsBitmaps(); |
574 } | 590 } |
575 SkFAIL("Unreachable"); | 591 SkFAIL("Unreachable"); |
576 return false; | 592 return false; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 int SkPicture::approximateOpCount() const { | 648 int SkPicture::approximateOpCount() const { |
633 SkASSERT(fRecord.get() || fData.get()); | 649 SkASSERT(fRecord.get() || fData.get()); |
634 if (fRecord.get()) { | 650 if (fRecord.get()) { |
635 return fRecord->count(); | 651 return fRecord->count(); |
636 } | 652 } |
637 if (fData.get()) { | 653 if (fData.get()) { |
638 return fData->opCount(); | 654 return fData->opCount(); |
639 } | 655 } |
640 return 0; | 656 return 0; |
641 } | 657 } |
OLD | NEW |