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

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: SkRecord visitor recursively measures SkPictures 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
Index: src/core/SkRecord.h
diff --git a/src/core/SkRecord.h b/src/core/SkRecord.h
index 6019e0340683c9f2077b04c3868ace677c0e2687..a70c050a62a7db8b598af95bf84322f3d87131be 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!
//
@@ -233,4 +239,4 @@ private:
unsigned fReserved;
};
-#endif//SkRecord_DEFINED
+#endif //SkRecord_DEFINED
mtklein 2014/11/18 21:38:32 oh snap
tomhudson 2014/11/18 21:49:37 Sigh, I guess there is no standard spec here? SkCa
mtklein 2014/11/18 21:54:35 Goodness, why would we ever have a standard spec f
« no previous file with comments | « src/core/SkRTree.cpp ('k') | src/core/SkTileGrid.h » ('j') | src/utils/SkPictureUtils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698