Support dump gfxinfo reset for process' without a Window
Bug: 199791928
Test: manual
Change-Id: I995d236c2c9d60194f72275a3da1c82340f77898
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 72d4ac5..430c4d3 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -257,10 +257,15 @@
});
}
-void RenderProxy::dumpGraphicsMemory(int fd, bool includeProfileData) {
+void RenderProxy::dumpGraphicsMemory(int fd, bool includeProfileData, bool resetProfile) {
if (RenderThread::hasInstance()) {
auto& thread = RenderThread::getInstance();
- thread.queue().runSync([&]() { thread.dumpGraphicsMemory(fd, includeProfileData); });
+ thread.queue().runSync([&]() {
+ thread.dumpGraphicsMemory(fd, includeProfileData);
+ if (resetProfile) {
+ thread.globalProfileData()->reset();
+ }
+ });
}
}