Skip unnecessary redraw request for sync

It is the similar with [1], but the condition was changed for
non-sync blast that mPrepareSyncSeqId will always be 0.

So add a case that assumes client will receive RELAYOUT_RES_FIRST_TIME,
then it already will report draw.

[1]: I6faad4b9adac7334df7caf3d23df59bd3e96bfd9

Bug: 258880446
Bug: 231435331
Test: Enable shell transition.
      While cold/warm/hot launch app or swipe to recents,
      there should only be one finishDrawing per window.
Change-Id: I955bd7509863c2cbb0e0706cc1dfba9ce99ce10e
This commit is contained in:
Riddle Hsu
2022-11-17 00:06:04 +08:00
parent 814729fe7a
commit e20d2b0e13

View File

@@ -6136,9 +6136,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (mRedrawForSyncReported) {
return false;
}
if (mInRelayout && mPrepareSyncSeqId > 0) {
// The last sync seq id will return to the client, so there is no need to request the
// client to redraw.
if (mInRelayout && (mPrepareSyncSeqId > 0 || (mViewVisibility == View.VISIBLE
&& mWinAnimator.mDrawState == DRAW_PENDING))) {
// The client will report draw if it gets the sync seq id from relayout or it is
// drawing for being visible, then no need to request redraw.
return false;
}
return useBLASTSync();