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

Unified Diff: src/core/SkQuadTree.cpp

Issue 490253003: Implement SkPicture::bytesUsed() for SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move to SkPictureUtils, start unit test 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/SkQuadTree.cpp
diff --git a/src/core/SkQuadTree.cpp b/src/core/SkQuadTree.cpp
index 1fc3cd0192a26c64efe3a06ef5baf4cfd8a17aec..ecf38b8b512826d5c4be4a58c1ca8896969f50ab 100644
--- a/src/core/SkQuadTree.cpp
+++ b/src/core/SkQuadTree.cpp
@@ -208,6 +208,14 @@ void SkQuadTree::rewindInserts() {
}
}
+size_t SkQuadTree::bytesUsed() const {
+ size_t byteCount = sizeof(SkQuadTree);
+ byteCount += fEntryPool.allocated() * sizeof(Entry);
+ byteCount += fNodePool.allocated() * sizeof(Node);
+ byteCount += fDeferred.getCount() * sizeof(Entry);
+ return byteCount;
+}
+
void SkQuadTree::flushDeferredInserts() {
if (NULL == fRoot) {
fRoot = fNodePool.acquire();

Powered by Google App Engine
This is Rietveld 408576698