Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48e4cb6a authored by Jorge Gil's avatar Jorge Gil Committed by Android (Google) Code Review
Browse files

Merge "Reland: Crop surface to the content size during drag-resizing" into main

parents 1f5b8523 c084015e
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -8413,11 +8413,21 @@ public final class ViewRootImpl implements ViewParent,
            }
        }

        if (mSurfaceControl.isValid() && !HardwareRenderer.isDrawingEnabled()) {
        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();
            }
        }

        mLastTransformHint = transformHint;