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

Unified Diff: src/core/SkRecord.h

Issue 490253003: Implement SkPicture::bytesUsed() for SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More tweaks for object size Created 6 years, 1 month 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
« no previous file with comments | « src/core/SkRTree.cpp ('k') | src/core/SkTileGrid.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecord.h
diff --git a/src/core/SkRecord.h b/src/core/SkRecord.h
index 6019e0340683c9f2077b04c3868ace677c0e2687..357f4fb16b562b169b4945f61feb8af2618bf50f 100644
--- a/src/core/SkRecord.h
+++ b/src/core/SkRecord.h
@@ -113,6 +113,12 @@ public:
return fRecords[i].set(this->allocCommand<T>());
}
+ // Does not return the bytes in any pointers embedded in the Records; callers
+ // need to iterate with a visitor to measure those they care for.
+ size_t bytesUsed() const { return fAlloc.approxBytesAllocated() +
+ fReserved * (sizeof(Record) + sizeof(Type8)) +
+ sizeof(SkRecord); }
+
private:
// Implementation notes!
//
« no previous file with comments | « src/core/SkRTree.cpp ('k') | src/core/SkTileGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698