From c80c9ad188ac6c421e70c906104d4394504878fb Mon Sep 17 00:00:00 2001 From: "youngmin0822.lee" Date: Fri, 20 Mar 2015 21:22:32 +0900 Subject: Don't create unnecessary RenderThread's instance when executing 'dumpsys gfxinfo' To obtain the gfxinfo for each process, the static method of RenderProxy is used, which is named outputLogBuffer(). In there, 1. RenderTask is created for getting DisplayList Commands in RenderNode. 2. staticPostAndWait() is called 3. RenderThread's instance is created by 'RenderThread::getInstance()' in staticPostAndWait() In case of the service, they don't use HW Acceleration, so don't need RenderThread. But, by the process of No.3, RenderThread is created for all process. As we know, RenderThread never be destroyed while the process is alive. This patch checks RenderThread instance before the creation of RenderTask. And, there is no one, just return to prevent the unnecessay creation of it. Change-Id: I4fe29d83c9ced3e8b67177c0874c5d8ee62e1870 --- libs/hwui/renderthread/RenderProxy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index 36ba3a9..1f61b23 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -395,6 +395,7 @@ CREATE_BRIDGE1(outputLogBuffer, int fd) { } void RenderProxy::outputLogBuffer(int fd) { + if (!RenderThread::hasInstance()) return; SETUP_TASK(outputLogBuffer); args->fd = fd; staticPostAndWait(task); -- cgit v1.1