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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkPicture.cpp
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index 160dd4b420df044adc9e03d761db7307cbcba459..e2dbed1b8604443507fe532c6ef2948d1f66de37 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -564,6 +564,22 @@ bool SkPicture::hasText() const {
return false;
}
+size_t SkPicture::bytesUsed() const {
+ size_t byteCount = sizeof(SkPicture);
+
+ // No support for old SkPicture backend
+ if (!fRecord.get()) {
+ return 0;
+ }
+
+ byteCount += fRecord->bytesUsed();
+ if (fBBH.get()) {
+ byteCount += fBBH->bytesUsed();
+ }
+ return byteCount;
+}
+
+
// fRecord OK
bool SkPicture::willPlayBackBitmaps() const {
if (fRecord.get()) {

Powered by Google App Engine
This is Rietveld 408576698