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

Commit 60af5183 authored by Robert Carr's avatar Robert Carr Committed by Rob Carr
Browse files

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
parent 16e6f529
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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,8 +2637,11 @@ public final class ViewRootImpl implements ViewParent,
                }

                cutoutChanged = !mPendingDisplayCutout.equals(mAttachInfo.mDisplayCutout);
                surfaceSizeChanged = (relayoutResult
                        & WindowManagerGlobal.RELAYOUT_RES_SURFACE_RESIZED) != 0;
                surfaceSizeChanged = false;
                if (!mLastSurfaceSize.equals(mSurfaceSize)) {
                    surfaceSizeChanged = true;
                    mLastSurfaceSize.set(mSurfaceSize.x, mSurfaceSize.y);
                }
                  final boolean alwaysConsumeSystemBarsChanged =
                        mPendingAlwaysConsumeSystemBars != mAttachInfo.mAlwaysConsumeSystemBars;
                updateColorModeIfNeeded(lp.getColorMode());
+0 −4
Original line number Diff line number Diff line
@@ -2381,10 +2381,6 @@ public class WindowManagerService extends IWindowManager.Stub
            if (win.mActivityRecord != null) {
                win.mActivityRecord.updateReportedVisibilityLocked();
            }
            if (winAnimator.mReportSurfaceResized) {
                winAnimator.mReportSurfaceResized = false;
                result |= WindowManagerGlobal.RELAYOUT_RES_SURFACE_RESIZED;
            }
            if (displayPolicy.areSystemBarsForcedShownLw(win)) {
                result |= WindowManagerGlobal.RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS;
            }
+1 −6
Original line number Diff line number Diff line
@@ -125,11 +125,7 @@ class WindowStateAnimator {
     * we must tell them application to resize (and thus redraw itself).
     */
    boolean mSurfaceResized;
    /**
     * Whether we should inform the client on next relayoutWindow that
     * the surface has been resized since last time.
     */
    boolean mReportSurfaceResized;

    WindowSurfaceController mSurfaceController;
    private WindowSurfaceController mPendingDestroySurface;

@@ -871,7 +867,6 @@ class WindowStateAnimator {
        }

        if (mSurfaceResized) {
            mReportSurfaceResized = true;
            mWin.getDisplayContent().pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
        }
    }