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

Unified Diff: cc/resources/ui_resource_bitmap.h

Issue 2406103002: [tracing] Add memory usage of Android UI resources to memory-infra (Closed)
Patch Set: nit. Created 4 years, 2 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: cc/resources/ui_resource_bitmap.h
diff --git a/cc/resources/ui_resource_bitmap.h b/cc/resources/ui_resource_bitmap.h
index 23492182b35d359082445f798990b9f607780848..b63db862c984d9b074a74e4b2bbc6f022feee643 100644
--- a/cc/resources/ui_resource_bitmap.h
+++ b/cc/resources/ui_resource_bitmap.h
@@ -51,6 +51,11 @@ class CC_EXPORT UIResourceBitmap {
UIResourceBitmap(const UIResourceBitmap& other);
~UIResourceBitmap();
+ // Returns the memory usage of the bitmap.
+ size_t BytesUsed() const {
+ return pixel_ref_ ? pixel_ref_->rowBytes() * size_.height() : 0;
David Trainor- moved to gerrit 2016/10/13 04:07:21 Would pixel_ref_->getAllocatedSizeInBytes() be mor
ssid 2016/10/13 17:45:16 Done.
ssid 2016/10/13 18:54:48 Sorry I misunderstood. Yes, I am planning to make
+ }
+
private:
friend class AutoLockUIResourceBitmap;

Powered by Google App Engine
This is Rietveld 408576698