summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2020-04-06 13:45:31 -0700
committerRobert Carr <racarr@google.com>2020-04-08 11:18:09 -0700
commit6cc720b70a8ee612d90f766df2dfde427d9f5e0d (patch)
tree2cc35981157e1240072f80d2b5016b30519f6d5c /core/java/android/view/ViewRootImpl.java
parent0e22967d6ca9c7b8e219f88ecefb0c819fbaf911 (diff)
ViewRootImpl: Pass buffer to finishDrawing when requested
As the final enabler for the BLASTSyncEngine, we add a new relayout result BLAST_SYNC. If the WindowState is participating in a BLAST sync during relayout we return it to the client. If we return it to the client the client will direct it's next draw in to a BLAST transaction and report that transaction via finishDrawing. You can now observe the BLASTSyncEngine working end to end in TaskOrganizerMultiWindowTests. We do a few small clean-ups in TaskOrganizerMultiWindowTest while we are there. Bug: 153561718 Test: TaskOrganizerMultiWindowTests Change-Id: I719b731350b942aafa444a33972aaef8973422ea
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r--core/java/android/view/ViewRootImpl.java17
1 files changed, 13 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);
+ }
}
}