summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorRob Carr <racarr@google.com>2021-02-11 01:24:45 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-02-11 01:24:45 +0000
commitaacd9886e56ac1f7338b7dc90cb6280f23fd65f5 (patch)
treeb20b98ec3366365a014f6769f0ba81b2d143fbbb /core/java/android
parent0ee5f13d6b388981b920e04498dc844755ad6cd5 (diff)
parentcec6bd9c7464eae1081123f73a14fc0d770b5f7b (diff)
Merge "ViewRootImpl: Use mergeWithNextTransaction for updating bounds layer" into sc-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/ViewRootImpl.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 4716141ee8d3..755ae31c077b 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1913,25 +1913,18 @@ public final class ViewRootImpl implements ViewParent,
private boolean updateBoundsLayer(SurfaceControl.Transaction t) {
if (mBoundsLayer != null) {
setBoundsLayerCrop(t);
- t.deferTransactionUntil(mBoundsLayer, getSurfaceControl(),
- mSurface.getNextFrameNumber());
return true;
}
return false;
}
- private void prepareSurfaces(boolean sizeChanged) {
+ private void prepareSurfaces() {
final SurfaceControl.Transaction t = mTransaction;
final SurfaceControl sc = getSurfaceControl();
if (!sc.isValid()) return;
- boolean applyTransaction = updateBoundsLayer(t);
- if (sizeChanged) {
- applyTransaction = true;
- t.setBufferSize(sc, mSurfaceSize.x, mSurfaceSize.y);
- }
- if (applyTransaction) {
- t.apply();
+ if (updateBoundsLayer(t)) {
+ mergeWithNextTransaction(t, mSurface.getNextFrameNumber());
}
}
@@ -3036,7 +3029,7 @@ public final class ViewRootImpl implements ViewParent,
// stopping, but on the client side it doesn't get stopped since it's restarted quick
// enough. WMS doesn't want to keep around old children since they will leak when the
// client creates new children.
- prepareSurfaces(surfaceSizeChanged);
+ prepareSurfaces();
}
final boolean didLayout = layoutRequested && (!mStopped || mReportNextDraw);