Loading libs/hwui/renderthread/RenderThread.cpp +13 −4 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "OpenGLReadback.h" #include "OpenGLReadback.h" #include "RenderProxy.h" #include "RenderProxy.h" #include "VulkanManager.h" #include "VulkanManager.h" #include "utils/FatVector.h" #include <gui/DisplayEventReceiver.h> #include <gui/DisplayEventReceiver.h> #include <gui/ISurfaceComposer.h> #include <gui/ISurfaceComposer.h> Loading Loading @@ -311,11 +312,19 @@ bool RenderThread::threadLoop() { "RenderThread Looper POLL_ERROR!"); "RenderThread Looper POLL_ERROR!"); nsecs_t nextWakeup; nsecs_t nextWakeup; // Process our queue, if we have anything { FatVector<RenderTask*, 10> workQueue; // Process our queue, if we have anything. By first acquiring // all the pending events then processing them we avoid vsync // starvation if more tasks are queued while we are processing tasks. while (RenderTask* task = nextTask(&nextWakeup)) { while (RenderTask* task = nextTask(&nextWakeup)) { workQueue.push_back(task); } for (auto task : workQueue) { task->run(); task->run(); // task may have deleted itself, do not reference it again // task may have deleted itself, do not reference it again } } } if (nextWakeup == LLONG_MAX) { if (nextWakeup == LLONG_MAX) { timeoutMillis = -1; timeoutMillis = -1; } else { } else { Loading Loading
libs/hwui/renderthread/RenderThread.cpp +13 −4 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "OpenGLReadback.h" #include "OpenGLReadback.h" #include "RenderProxy.h" #include "RenderProxy.h" #include "VulkanManager.h" #include "VulkanManager.h" #include "utils/FatVector.h" #include <gui/DisplayEventReceiver.h> #include <gui/DisplayEventReceiver.h> #include <gui/ISurfaceComposer.h> #include <gui/ISurfaceComposer.h> Loading Loading @@ -311,11 +312,19 @@ bool RenderThread::threadLoop() { "RenderThread Looper POLL_ERROR!"); "RenderThread Looper POLL_ERROR!"); nsecs_t nextWakeup; nsecs_t nextWakeup; // Process our queue, if we have anything { FatVector<RenderTask*, 10> workQueue; // Process our queue, if we have anything. By first acquiring // all the pending events then processing them we avoid vsync // starvation if more tasks are queued while we are processing tasks. while (RenderTask* task = nextTask(&nextWakeup)) { while (RenderTask* task = nextTask(&nextWakeup)) { workQueue.push_back(task); } for (auto task : workQueue) { task->run(); task->run(); // task may have deleted itself, do not reference it again // task may have deleted itself, do not reference it again } } } if (nextWakeup == LLONG_MAX) { if (nextWakeup == LLONG_MAX) { timeoutMillis = -1; timeoutMillis = -1; } else { } else { Loading