diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-05-13 01:07:48 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-05-13 01:07:48 +0000 |
commit | 5a1367ea286405cfb596b50d2b418bdee154a6f4 (patch) | |
tree | 3a41f06b3c13fdc53519ece4d29a947c07676f08 /libs/hwui/renderthread/RenderThread.cpp | |
parent | a3cae58636a3f6f331354d8bfbe1f0dcba31f535 (diff) | |
parent | 3009a4d87dee1ba5b24bed52fb74136ac2944393 (diff) |
Snap for 7357013 from 3009a4d87dee1ba5b24bed52fb74136ac2944393 to sc-release
Change-Id: I80e36a06e60537dae14e4185bc14f8040b59a310
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderThread.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp index 3421e01b1585..308352d34174 100644 --- a/libs/hwui/renderthread/RenderThread.cpp +++ b/libs/hwui/renderthread/RenderThread.cpp @@ -302,30 +302,25 @@ VulkanManager& RenderThread::vulkanManager() { return *mVkManager.get(); } -void RenderThread::dumpGraphicsMemory(int fd) { - globalProfileData()->dump(fd); - - String8 cachesOutput; - String8 pipeline; - auto renderType = Properties::getRenderPipelineType(); - switch (renderType) { - case RenderPipelineType::SkiaGL: { - mCacheManager->dumpMemoryUsage(cachesOutput, mRenderState); - pipeline.appendFormat("Skia (OpenGL)"); - break; - } - case RenderPipelineType::SkiaVulkan: { - mCacheManager->dumpMemoryUsage(cachesOutput, mRenderState); - pipeline.appendFormat("Skia (Vulkan)"); - break; - } +static const char* pipelineToString() { + switch (auto renderType = Properties::getRenderPipelineType()) { + case RenderPipelineType::SkiaGL: + return "Skia (OpenGL)"; + case RenderPipelineType::SkiaVulkan: + return "Skia (Vulkan)"; default: LOG_ALWAYS_FATAL("canvas context type %d not supported", (int32_t)renderType); - break; } +} - dprintf(fd, "\n%s\n", cachesOutput.string()); - dprintf(fd, "\nPipeline=%s\n", pipeline.string()); +void RenderThread::dumpGraphicsMemory(int fd, bool includeProfileData) { + if (includeProfileData) { + globalProfileData()->dump(fd); + } + + String8 cachesOutput; + mCacheManager->dumpMemoryUsage(cachesOutput, mRenderState); + dprintf(fd, "\nPipeline=%s\n%s\n", pipelineToString(), cachesOutput.string()); } Readback& RenderThread::readback() { |