diff options
author | John Reck <jreck@google.com> | 2019-10-09 13:41:18 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2019-10-09 13:42:43 -0700 |
commit | 183e1380cef0f63610497abed01e16036a2ea2d4 (patch) | |
tree | 6be42299bdadf7fae5aaf58f787070123c6371aa /libs/hwui/RenderNode.cpp | |
parent | 3441faa0453907f8713ebccfa33049c2e99e4fe6 (diff) |
Improve dumping of display list memory usage
The first step of improving is measuring. So measure better.
Bug: 138856108
Test: dump
Change-Id: I076b904a1f0dfb209622c76bcb8778a10cd2b7db
Diffstat (limited to 'libs/hwui/RenderNode.cpp')
-rw-r--r-- | libs/hwui/RenderNode.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index 8eb5e3d3dfbc..6761435a8171 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -108,7 +108,7 @@ void RenderNode::output(std::ostream& output, uint32_t level) { output << std::endl; } -int RenderNode::getDebugSize() { +int RenderNode::getUsageSize() { int size = sizeof(RenderNode); if (mStagingDisplayList) { size += mStagingDisplayList->getUsedSize(); @@ -119,6 +119,18 @@ int RenderNode::getDebugSize() { return size; } +int RenderNode::getAllocatedSize() { + int size = sizeof(RenderNode); + if (mStagingDisplayList) { + size += mStagingDisplayList->getAllocatedSize(); + } + if (mDisplayList && mDisplayList != mStagingDisplayList) { + size += mDisplayList->getAllocatedSize(); + } + return size; +} + + void RenderNode::prepareTree(TreeInfo& info) { ATRACE_CALL(); LOG_ALWAYS_FATAL_IF(!info.damageAccumulator, "DamageAccumulator missing"); |