From 113a34ad0d2134a4f255c704e6ae80797900fa8d Mon Sep 17 00:00:00 2001 From: Jorge Gil Date: Wed, 21 Jun 2023 16:48:59 +0000 Subject: [PATCH] Revert "Crop surface to the content size during drag-resizing" This reverts commit 52530935ec5bde9455179833f0db438413fdee40. Reason for revert: b/288238372 Change-Id: Ic2a25c7abf03ca21fc4b08099b7529f4a9308aec --- core/java/android/view/ViewRootImpl.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index aec5608b569d0..7108805d9c718 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -8317,20 +8317,10 @@ public final class ViewRootImpl implements ViewParent, } } - if (mSurfaceControl.isValid()) { - if (mPendingDragResizing && !mSurfaceSize.equals( - mWinFrameInScreen.width(), mWinFrameInScreen.height())) { - // During drag-resize, a single fullscreen-sized surface is reused for optimization. - // Crop to the content size instead of the surface size to avoid exposing garbage - // content that is still on the surface from previous re-layouts (e.g. when - // resizing to a larger size). - mTransaction.setWindowCrop(mSurfaceControl, - mWinFrameInScreen.width(), mWinFrameInScreen.height()); - } else if (!HardwareRenderer.isDrawingEnabled()) { - // When drawing is disabled the window layer won't have a valid buffer. - // Set a window crop so input can get delivered to the window. - mTransaction.setWindowCrop(mSurfaceControl, mSurfaceSize.x, mSurfaceSize.y).apply(); - } + if (mSurfaceControl.isValid() && !HardwareRenderer.isDrawingEnabled()) { + // When drawing is disabled the window layer won't have a valid buffer. + // Set a window crop so input can get delivered to the window. + mTransaction.setWindowCrop(mSurfaceControl, mSurfaceSize.x, mSurfaceSize.y).apply(); } mLastTransformHint = transformHint;