From 70a8f0ea9848a29c21d1ad1ce4ad5e004f2ee49a Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Wed, 14 Oct 2020 18:47:46 -0700 Subject: [PATCH] HWUI: Finish frame callbacks before framecomplete callbacks If returning early from a draw, there is a chance that the frame complete callbacks can execute before the frame callbacks. To fix this, explicitly wait on frame callbacks to complete. Test: Enable blast and test split screen resize Change-Id: Id0eabd4dacdccbf1ce774efaad51abae7c57d5ea --- libs/hwui/renderthread/CanvasContext.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 1ac99228c52c3..eacabfd1dbf9f 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -465,6 +465,7 @@ void CanvasContext::draw() { mCurrentFrameInfo->addFlag(FrameInfoFlags::SkippedFrame); // Notify the callbacks, even if there's nothing to draw so they aren't waiting // indefinitely + waitOnFences(); for (auto& func : mFrameCompleteCallbacks) { std::invoke(func, mFrameNumber); }