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

Unified Diff: cc/resources/ui_resource_bitmap.h

Issue 2406103002: [tracing] Add memory usage of Android UI resources to memory-infra (Closed)
Patch Set: Fixes. 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
« no previous file with comments | « cc/resources/scoped_ui_resource.h ('k') | ui/android/resources/crushed_sprite_resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6f2c780fcb9081dfef259ec974b7cfaed6ea33cc 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 GetAllocatedSizeInBytes() const {
+ return pixel_ref_ ? pixel_ref_->rowBytes() * size_.height() : 0;
ericrk 2016/10/14 00:07:38 I think this is fine - in some other places we use
David Trainor- moved to gerrit 2016/10/14 01:35:31 Ah yeah sorry I didn't realize the other method wa
ssid 2016/10/14 01:38:22 Okay keeping it as is. I will ping Skia owners to
+ }
+
private:
friend class AutoLockUIResourceBitmap;
« no previous file with comments | « cc/resources/scoped_ui_resource.h ('k') | ui/android/resources/crushed_sprite_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698