diff options
| author | Rob Carr <racarr@google.com> | 2020-05-11 21:46:19 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-05-11 21:46:19 +0000 |
| commit | 85c13cf111e73733ce529cdc9a60a20ba2a4f80c (patch) | |
| tree | 1576dd6624ff753dc04cc1678d24c0d995a24715 /core/java/android/view/ViewRootImpl.java | |
| parent | d498a65696ba8f25e86a384745133e87c0e884fb (diff) | |
| parent | fb8ccaa1bcd4d0cedd9876079407e85b7f1d1132 (diff) | |
Merge "BLASTBufferQueue: Fix two conditions leading to freeze." into rvc-dev
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 172197c8f396..5b9cd7786a39 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -704,6 +704,11 @@ public final class ViewRootImpl implements ViewParent, // draw returns. private SurfaceControl.Transaction mRtBLASTSyncTransaction = new SurfaceControl.Transaction(); + // Keeps track of whether the WM requested us to use BLAST Sync when calling relayout. + // We use this to make sure we don't send the WM transactions from an internal BLAST sync + // (e.g. SurfaceView) + private boolean mSendNextFrameToWm = false; + private HashSet<ScrollCaptureCallback> mRootScrollCaptureCallbacks; private String mTag = TAG; @@ -3053,6 +3058,7 @@ public final class ViewRootImpl implements ViewParent, if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_BLAST_SYNC) != 0) { reportNextDraw(); setUseBLASTSyncTransaction(); + mSendNextFrameToWm = true; } boolean cancelDraw = mAttachInfo.mTreeObserver.dispatchOnPreDraw() || !isViewVisible; @@ -3762,7 +3768,7 @@ public final class ViewRootImpl implements ViewParent, if (needFrameCompleteCallback) { final Handler handler = mAttachInfo.mHandler; mAttachInfo.mThreadedRenderer.setFrameCompleteCallback((long frameNr) -> { - finishBLASTSync(!reportNextDraw); + finishBLASTSync(!mSendNextFrameToWm); handler.postAtFrontOfQueue(() -> { if (reportNextDraw) { // TODO: Use the frame number @@ -3784,7 +3790,7 @@ public final class ViewRootImpl implements ViewParent, // so if we are BLAST syncing we make sure the previous draw has // totally finished. if (mAttachInfo.mThreadedRenderer != null) { - mAttachInfo.mThreadedRenderer.fence(); + mAttachInfo.mThreadedRenderer.pause(); } mNextReportConsumeBLAST = true; @@ -9757,6 +9763,7 @@ public final class ViewRootImpl implements ViewParent, } private void finishBLASTSync(boolean apply) { + mSendNextFrameToWm = false; if (mNextReportConsumeBLAST) { mNextReportConsumeBLAST = false; |
