Merge "Only allow one relayout with sync per sync request"

This commit is contained in:
Chavi Weingarten
2021-10-28 19:09:22 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 1 deletions

View File

@@ -2500,9 +2500,11 @@ public class WindowManagerService extends IWindowManager.Stub
}
win.mInRelayout = false;
if (mUseBLASTSync && win.useBLASTSync() && viewVisibility != View.GONE) {
if (mUseBLASTSync && win.useBLASTSync() && viewVisibility != View.GONE
&& win.mNextRelayoutUseSync) {
win.prepareDrawHandlers();
win.markRedrawForSyncReported();
win.mNextRelayoutUseSync = false;
result |= RELAYOUT_RES_BLAST_SYNC;
}

View File

@@ -363,6 +363,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
private boolean mDragResizingChangeReported = true;
private int mResizeMode;
private boolean mRedrawForSyncReported;
boolean mNextRelayoutUseSync;
/**
* {@code true} when the client was still drawing for sync when the sync-set was finished or
@@ -5659,6 +5660,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// to draw even if the children draw first or don't need to sync, so we start
// in WAITING state rather than READY.
mSyncState = SYNC_STATE_WAITING_FOR_DRAW;
mNextRelayoutUseSync = true;
requestRedrawForSync();
return true;
}
@@ -5840,6 +5842,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
*/
void applyWithNextDraw(Consumer<SurfaceControl.Transaction> consumer) {
mPendingDrawHandlers.add(consumer);
mNextRelayoutUseSync = true;
requestRedrawForSync();
mWmService.mH.sendNewMessageDelayed(WINDOW_STATE_BLAST_SYNC_TIMEOUT, this,