summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorRobert Carr <racarr@google.com>2020-07-23 12:13:34 -0700
committerRob Carr <racarr@google.com>2020-09-09 01:27:15 +0000
commit60af51835d41b78f96dbee9d3516cca98328476e (patch)
tree1fd35c9dcc11eb8487cce49acc0146d2b11d24b9 /core/java
parent16e6f529d3c09f3bcf6763ac538907f7a795186f (diff)
WSA/ViewRootImpl: Move resize detection to client
Part of the chain of moving surface size ownership to the client and making relayout asynchronous. We were already sending Surface size to the client so it's easy to just use that and avoid sending an extra result flag. Bug: 161937501 Test: Existing tests pass Change-Id: I18a96616d2cf082197fbbd434a737ed77ba40e9c
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/ViewRootImpl.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 3f02d701f71f..8bde9877a744 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -462,6 +462,7 @@ public final class ViewRootImpl implements ViewParent,
// used in relayout to get SurfaceControl size
// for BLAST adapter surface setup
private final Point mSurfaceSize = new Point();
+ private final Point mLastSurfaceSize = new Point();
final Rect mTempRect; // used in the transaction to not thrash the heap.
final Rect mVisRect; // used to retrieve visible rect of focused view.
@@ -2636,9 +2637,12 @@ public final class ViewRootImpl implements ViewParent,
}
cutoutChanged = !mPendingDisplayCutout.equals(mAttachInfo.mDisplayCutout);
- surfaceSizeChanged = (relayoutResult
- & WindowManagerGlobal.RELAYOUT_RES_SURFACE_RESIZED) != 0;
- final boolean alwaysConsumeSystemBarsChanged =
+ surfaceSizeChanged = false;
+ if (!mLastSurfaceSize.equals(mSurfaceSize)) {
+ surfaceSizeChanged = true;
+ mLastSurfaceSize.set(mSurfaceSize.x, mSurfaceSize.y);
+ }
+ final boolean alwaysConsumeSystemBarsChanged =
mPendingAlwaysConsumeSystemBars != mAttachInfo.mAlwaysConsumeSystemBars;
updateColorModeIfNeeded(lp.getColorMode());
surfaceCreated = !hadSurface && mSurface.isValid();