summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp
diff options
context:
space:
mode:
authorBrian Orr <brianorr@google.com>2021-06-15 12:47:53 -0700
committerDaniel Norman <danielnorman@google.com>2021-06-17 13:37:54 -0700
commit71c831703ae59baf47e0afe611fecd714c481cdf (patch)
tree06731a987032723085b9e1a65951cf96abbc19cf /libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp
parent065c9e9a6e9d61d4383a91721eb56a3de253bdbe (diff)
parent81833820d54b9a6b27894f9f8dfd72222d416992 (diff)
Merge SP1A.210604.001
Change-Id: I5200ee05285ae422d5e9c1c00f45709a5d6188be
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp')
-rw-r--r--libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp b/libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp
index 0b995bc295de..10427039c35a 100644
--- a/libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp
+++ b/libs/hwui/pipeline/skia/SkiaMemoryTracer.cpp
@@ -86,12 +86,9 @@ void SkiaMemoryTracer::processElement() {
}
}
- // if we don't have a resource name then we don't know how to label the
- // data and should abort.
+ // if we don't have a pretty name then use the dumpName
if (resourceName == nullptr) {
- mCurrentElement.clear();
- mCurrentValues.clear();
- return;
+ resourceName = mCurrentElement.c_str();
}
auto result = mResults.find(resourceName);
@@ -157,6 +154,14 @@ void SkiaMemoryTracer::logOutput(String8& log) {
}
}
+size_t SkiaMemoryTracer::total() {
+ processElement();
+ if (!strcmp("bytes", mTotalSize.units)) {
+ return mTotalSize.value;
+ }
+ return 0;
+}
+
void SkiaMemoryTracer::logTotals(String8& log) {
TraceValue total = convertUnits(mTotalSize);
TraceValue purgeable = convertUnits(mPurgeableSize);