diff options
| author | Robert Carr <racarr@google.com> | 2020-01-22 13:32:38 -0800 |
|---|---|---|
| committer | Robert Carr <racarr@google.com> | 2020-01-27 16:47:33 -0800 |
| commit | 2e20bcd65ecdb06eeaac2dc8356dec90c756d271 (patch) | |
| tree | 707c73d18147e571adcf388036a0c0510770d99c /core/java/android/view/ViewRootImpl.java | |
| parent | 6871767aaa276165c41db4c330e9ebe07cd7501c (diff) | |
WM: Defer transactions for BLAST Surfaces too.
For switching on BLAST we are implementing deferred transactions for
compatibility. Presently the BLAST Surface is constructed by the ViewRootImpl
and so the WM has no reference to pass when using it as a barrier layer for
deferTransactionUntil. To resolve this we construct and hold a reference to
the BLAST Surface on the server side, and pass it down to the client in relayoutWindow.
We don't use the WindowStateAnimator surface directly as both the BLAST Adapter and
the WindowStateAnimator would then be setting crops on it.
Bug: 146598493
Test: Builds, existing tests pass.
Change-Id: I6513e0442f5c75f01eb8dde5f1924dd7b636163c
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 7a93dcc9e4ec..fbcc261a956e 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -507,7 +507,7 @@ public final class ViewRootImpl implements ViewParent, @UnsupportedAppUsage public final Surface mSurface = new Surface(); private final SurfaceControl mSurfaceControl = new SurfaceControl(); - private SurfaceControl mBlastSurfaceControl; + private SurfaceControl mBlastSurfaceControl = new SurfaceControl(); private BLASTBufferQueue mBlastBufferQueue; @@ -1690,23 +1690,17 @@ public final class ViewRootImpl implements ViewParent, .build(); setBoundsLayerCrop(); mTransaction.show(mBoundsLayer).apply(); - } - return mBoundsLayer; + } + return mBoundsLayer; } Surface getOrCreateBLASTSurface(int width, int height) { if (mSurfaceControl == null || !mSurfaceControl.isValid()) { return null; } - if (mBlastSurfaceControl == null) { - mBlastSurfaceControl = new SurfaceControl.Builder(mSurfaceSession) - .setParent(mSurfaceControl) - .setName("BLAST") - .setBLASTLayer() - .build(); + if ((mBlastBufferQueue != null) && mBlastSurfaceControl.isValid()) { mBlastBufferQueue = new BLASTBufferQueue( mBlastSurfaceControl, width, height); - } mBlastBufferQueue.update(mBlastSurfaceControl, width, height); @@ -7344,7 +7338,8 @@ public final class ViewRootImpl implements ViewParent, insetsPending ? WindowManagerGlobal.RELAYOUT_INSETS_PENDING : 0, frameNumber, mTmpFrame, mPendingContentInsets, mPendingVisibleInsets, mPendingStableInsets, mPendingBackDropFrame, mPendingDisplayCutout, - mPendingMergedConfiguration, mSurfaceControl, mTempInsets, mSurfaceSize); + mPendingMergedConfiguration, mSurfaceControl, mTempInsets, mSurfaceSize, + mBlastSurfaceControl); if (mSurfaceControl.isValid()) { if (!WindowManagerGlobal.USE_BLAST_ADAPTER) { mSurface.copyFrom(mSurfaceControl); |
