Improve dumping of display list memory usage

The first step of improving is measuring. So measure better.

Bug: 138856108
Test: dump
Change-Id: I076b904a1f0dfb209622c76bcb8778a10cd2b7db
This commit is contained in:
John Reck
2019-10-09 13:41:18 -07:00
parent 3441faa045
commit 183e1380ce
10 changed files with 83 additions and 30 deletions

View File

@@ -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");