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; |