diff options
Diffstat (limited to 'libs/hwui/renderthread')
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 706e14e..f9af15f 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -156,10 +156,18 @@ void CanvasContext::processLayerUpdate(DeferredLayerUpdater* layerUpdater) { } } +static bool wasSkipped(FrameInfo* info) { + return info && ((*info)[FrameInfoIndex::kFlags] & FrameInfoFlags::kSkippedFrame); +} + void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo) { mRenderThread.removeFrameCallback(this); - mCurrentFrameInfo = &mFrames.next(); + // If the previous frame was dropped we don't need to hold onto it, so + // just keep using the previous frame's structure instead + if (!wasSkipped(mCurrentFrameInfo)) { + mCurrentFrameInfo = &mFrames.next(); + } mCurrentFrameInfo->importUiThreadInfo(uiFrameInfo); mCurrentFrameInfo->markSyncStart(); |