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

Unified Diff: src/core/SkTileGrid.cpp

Issue 490253003: Implement SkPicture::bytesUsed() for SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Unit test prevents bloat 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/SkTileGrid.cpp
diff --git a/src/core/SkTileGrid.cpp b/src/core/SkTileGrid.cpp
index e285cccd0bff506a67614b4a3305a4fe1ffb1170..e023e3539b04d2b0fa72468cabcf44fd494af529 100644
--- a/src/core/SkTileGrid.cpp
+++ b/src/core/SkTileGrid.cpp
@@ -175,3 +175,12 @@ void SkTileGrid::search(const SkRect& originalQuery, SkTDArray<unsigned>* result
}
}
+size_t SkTileGrid::bytesUsed() const {
+ size_t byteCount = sizeof(SkTileGrid);
+
+ for (int i = 0; i < fXTiles * fYTiles; i++) {
chrishtr 2014/11/17 21:34:21 Will this be slow? Overall, what asymptotic runtim
tomhudson 2014/11/17 22:12:15 If the tile grid just spans a screen on the Nexus
+ byteCount = fTiles[i].reserved() * sizeof(unsigned);
mtklein 2014/11/17 23:15:33 I think you want += here? While you're at it, can
+ }
+
+ return byteCount;
+}

Powered by Google App Engine
This is Rietveld 408576698