diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 17 | ||||
| -rw-r--r-- | core/java/android/view/WindowManagerGlobal.java | 8 |
2 files changed, 21 insertions, 4 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 1e96a1c21ac3..7b89620a9a84 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -3014,6 +3014,10 @@ public final class ViewRootImpl implements ViewParent, if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_FIRST_TIME) != 0) { reportNextDraw(); } + if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_BLAST_SYNC) != 0) { + reportNextDraw(); + setUseBLASTSyncTransaction(); + } boolean cancelDraw = mAttachInfo.mTreeObserver.dispatchOnPreDraw() || !isViewVisible; @@ -3722,7 +3726,7 @@ public final class ViewRootImpl implements ViewParent, if (needFrameCompleteCallback) { final Handler handler = mAttachInfo.mHandler; mAttachInfo.mThreadedRenderer.setFrameCompleteCallback((long frameNr) -> { - finishBLASTSync(); + finishBLASTSync(!reportNextDraw); handler.postAtFrontOfQueue(() -> { if (reportNextDraw) { // TODO: Use the frame number @@ -3756,7 +3760,7 @@ public final class ViewRootImpl implements ViewParent, if (usingAsyncReport && !canUseAsync) { mAttachInfo.mThreadedRenderer.setFrameCompleteCallback(null); usingAsyncReport = false; - finishBLASTSync(); + finishBLASTSync(true /* apply */); } } finally { mIsDrawing = false; @@ -9572,10 +9576,15 @@ public final class ViewRootImpl implements ViewParent, mNextDrawUseBLASTSyncTransaction = true; } - private void finishBLASTSync() { + private void finishBLASTSync(boolean apply) { if (mNextReportConsumeBLAST) { mNextReportConsumeBLAST = false; - mRtBLASTSyncTransaction.apply(); + + if (apply) { + mRtBLASTSyncTransaction.apply(); + } else { + mSurfaceChangedTransaction.merge(mRtBLASTSyncTransaction); + } } } diff --git a/core/java/android/view/WindowManagerGlobal.java b/core/java/android/view/WindowManagerGlobal.java index 410d9afe73da..ab968d798745 100644 --- a/core/java/android/view/WindowManagerGlobal.java +++ b/core/java/android/view/WindowManagerGlobal.java @@ -102,6 +102,14 @@ public final class WindowManagerGlobal { public static final int RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS = 0x40; /** + * This flag indicates the client should not directly submit it's next frame, + * but instead should pass it in the postDrawTransaction of + * {@link WindowManagerService#finishDrawing}. This is used by the WM + * BLASTSyncEngine to synchronize rendering of multiple windows. + */ + public static final int RELAYOUT_RES_BLAST_SYNC = 0x80; + + /** * Flag for relayout: the client will be later giving * internal insets; as a result, the window will not impact other window * layouts until the insets are given. |
