diff options
| author | Rob Carr <racarr@google.com> | 2021-07-09 02:28:27 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-07-09 02:28:27 +0000 |
| commit | 5f28230d3485ad4bb776a2f052b2152ae338e972 (patch) | |
| tree | 5526fb425b96db6a56ca8baffe1dc479ef08a2c6 /core/java/android/view/ViewRootImpl.java | |
| parent | 7f162ddaf04a950348b737b3c88af25fd545cba4 (diff) | |
| parent | a93fcc9e3391beb48caa45074b1b4b6d967b5d1a (diff) | |
Merge "ViewRootImpl: Fix issue with early draw report in seamless rotation" into sc-dev
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 2bd2be12ca16..280685065aaf 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -2778,6 +2778,7 @@ public final class ViewRootImpl implements ViewParent, mView.onSystemBarAppearanceChanged(mDispatchedSystemBarAppearance); } } + final boolean wasReportNextDraw = mReportNextDraw; if (mFirst || windowShouldResize || viewVisibilityChanged || params != null || mForceNextWindowRelayout) { @@ -2824,6 +2825,16 @@ public final class ViewRootImpl implements ViewParent, final boolean dockedResizing = (relayoutResult & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_DOCKED) != 0; final boolean dragResizing = freeformResizing || dockedResizing; + if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_BLAST_SYNC) != 0) { + if (DEBUG_BLAST) { + Log.d(mTag, "Relayout called with blastSync"); + } + reportNextDraw(); + if (isHardwareEnabled()) { + mNextDrawUseBlastSync = true; + } + } + if (mSurfaceControl.isValid()) { updateOpacity(mWindowAttributes, dragResizing); } @@ -3042,7 +3053,16 @@ public final class ViewRootImpl implements ViewParent, } } - if (!mStopped || mReportNextDraw) { + // TODO: In the CL "ViewRootImpl: Fix issue with early draw report in + // seamless rotation". We moved processing of RELAYOUT_RES_BLAST_SYNC + // earlier in the function, potentially triggering a call to + // reportNextDraw(). That same CL changed this and the next reference + // to wasReportNextDraw, such that this logic would remain undisturbed + // (it continues to operate as if the code was never moved). This was + // done to achieve a more hermetic fix for S, but it's entirely + // possible that checking the most recent value is actually more + // correct here. + if (!mStopped || wasReportNextDraw) { boolean focusChangedDueToTouchMode = ensureTouchModeLocally( (relayoutResult&WindowManagerGlobal.RELAYOUT_RES_IN_TOUCH_MODE) != 0); if (focusChangedDueToTouchMode || mWidth != host.getMeasuredWidth() @@ -3112,7 +3132,7 @@ public final class ViewRootImpl implements ViewParent, prepareSurfaces(); } - final boolean didLayout = layoutRequested && (!mStopped || mReportNextDraw); + final boolean didLayout = layoutRequested && (!mStopped || wasReportNextDraw); boolean triggerGlobalLayoutListener = didLayout || mAttachInfo.mRecomputeGlobalAttributes; if (didLayout) { @@ -3268,21 +3288,10 @@ public final class ViewRootImpl implements ViewParent, mImeFocusController.onTraversal(hasWindowFocus, mWindowAttributes); - final boolean wasReportNextDraw = mReportNextDraw; - // Remember if we must report the next draw. if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_FIRST_TIME) != 0) { reportNextDraw(); } - if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_BLAST_SYNC) != 0) { - if (DEBUG_BLAST) { - Log.d(mTag, "Relayout called with blastSync"); - } - reportNextDraw(); - if (isHardwareEnabled()) { - mNextDrawUseBlastSync = true; - } - } boolean cancelDraw = mAttachInfo.mTreeObserver.dispatchOnPreDraw() || !isViewVisible; @@ -3293,7 +3302,6 @@ public final class ViewRootImpl implements ViewParent, } mPendingTransitions.clear(); } - performDraw(); } else { if (isViewVisible) { |
