diff options
author | Steven Laver <lavers@google.com> | 2020-01-23 17:03:21 -0800 |
---|---|---|
committer | Steven Laver <lavers@google.com> | 2020-02-04 23:22:55 +0000 |
commit | 71998c3d8b36220df1be12fe6e1ba7eda81cde41 (patch) | |
tree | 8b5e07fadfa5561f430abd298094046a496c3fb3 /libs/hwui/renderthread/CacheManager.cpp | |
parent | 4307c64762e7fd78e8cdd955296655d51a6094e2 (diff) | |
parent | db0ac39741da692dddac3ff31aa87634af92e1e8 (diff) |
Merge RP1A.200123.001
Change-Id: I16a4437d9876db7a6a2b07231b4584df4564bee4
Diffstat (limited to 'libs/hwui/renderthread/CacheManager.cpp')
-rw-r--r-- | libs/hwui/renderthread/CacheManager.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CacheManager.cpp b/libs/hwui/renderthread/CacheManager.cpp index eaed46c44e5d..d177855e5a7d 100644 --- a/libs/hwui/renderthread/CacheManager.cpp +++ b/libs/hwui/renderthread/CacheManager.cpp @@ -20,10 +20,12 @@ #include "Layer.h" #include "Properties.h" #include "RenderThread.h" +#include "pipeline/skia/ATraceMemoryDump.h" #include "pipeline/skia/ShaderCache.h" #include "pipeline/skia/SkiaMemoryTracer.h" #include "renderstate/RenderState.h" #include "thread/CommonPool.h" +#include <utils/Trace.h> #include <GrContextOptions.h> #include <SkExecutor.h> @@ -184,6 +186,18 @@ void CacheManager::dumpMemoryUsage(String8& log, const RenderState* renderState) gpuTracer.logTotals(log); } +void CacheManager::onFrameCompleted() { + if (ATRACE_ENABLED()) { + static skiapipeline::ATraceMemoryDump tracer; + tracer.startFrame(); + SkGraphics::DumpMemoryStatistics(&tracer); + if (mGrContext) { + mGrContext->dumpMemoryStatistics(&tracer); + } + tracer.logTraces(); + } +} + } /* namespace renderthread */ } /* namespace uirenderer */ } /* namespace android */ |