Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: src/core/SkPicture.cpp

Issue 490253003: Implement SkPicture::bytesUsed() for SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698