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

Commit cc5491da authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "WindowManager: Avoid reparenting BLAST Surface in reparentChildren"...

Merge "WindowManager: Avoid reparenting BLAST Surface in reparentChildren" into rvc-dev am: c2adc8d6 am: e9d7efd3 am: 932919ff

Change-Id: I980a52d1e86e9555b0d89506e7fc9d63c39687c3
parents 50e24c18 932919ff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1735,7 +1735,7 @@ public final class ViewRootImpl implements ViewParent,
            mBoundsLayer = new SurfaceControl.Builder(mSurfaceSession)
                    .setContainerLayer()
                    .setName("Bounds for - " + getTitle().toString())
                    .setParent(mSurfaceControl)
                    .setParent(getRenderSurfaceControl())
                    .build();
            setBoundsLayerCrop();
            mTransaction.show(mBoundsLayer).apply();
+1 −1
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ class InsetsSourceProvider {
            // window crop of the surface controls (including the leash) until the client finishes
            // drawing the new frame of the new orientation. Although we cannot defer the reparent
            // operation, it is fine, because reparent won't cause any visual effect.
            final SurfaceControl barrier = mWin.getDeferTransactionBarrier();
            final SurfaceControl barrier = mWin.getClientViewRootSurface();
            t.deferTransactionUntil(mWin.getSurfaceControl(), barrier, frameNumber);
            t.deferTransactionUntil(leash, barrier, frameNumber);
        }
+2 −2
Original line number Diff line number Diff line
@@ -118,9 +118,9 @@ public class SeamlessRotator {
        finish(t, win);
        if (win.mWinAnimator.mSurfaceController != null && !timeout) {
            t.deferTransactionUntil(win.mSurfaceControl,
                    win.getDeferTransactionBarrier(), win.getFrameNumber());
                    win.getClientViewRootSurface(), win.getFrameNumber());
            t.deferTransactionUntil(win.mWinAnimator.mSurfaceController.mSurfaceControl,
                    win.getDeferTransactionBarrier(), win.getFrameNumber());
                    win.getClientViewRootSurface(), win.getFrameNumber());
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -5660,8 +5660,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        return mSession.mPid == pid && isNonToastOrStarting() && isVisibleNow();
    }

    SurfaceControl getDeferTransactionBarrier() {
        return mWinAnimator.getDeferTransactionBarrier();
    SurfaceControl getClientViewRootSurface() {
        return mWinAnimator.getClientViewRootSurface();
    }

    @Override
+14 −12
Original line number Diff line number Diff line
@@ -383,7 +383,8 @@ class WindowStateAnimator {
            // Make sure to reparent any children of the new surface back to the preserved
            // surface before destroying it.
            if (mSurfaceController != null && mPendingDestroySurface != null) {
                mPostDrawTransaction.reparentChildren(mSurfaceController.mSurfaceControl,
                mPostDrawTransaction.reparentChildren(
                    mSurfaceController.getClientViewRootSurface(),
                    mPendingDestroySurface.mSurfaceControl).apply();
            }
            destroySurfaceLocked();
@@ -413,9 +414,9 @@ class WindowStateAnimator {
                // child layers need to be reparented to the new surface to make this
                // transparent to the app.
                if (mWin.mActivityRecord == null || mWin.mActivityRecord.isRelaunching() == false) {
                    mPostDrawTransaction.reparentChildren(mPendingDestroySurface.mSurfaceControl,
                            mSurfaceController.mSurfaceControl)
                            .apply();
                    mPostDrawTransaction.reparentChildren(
                        mPendingDestroySurface.getClientViewRootSurface(),
                        mSurfaceController.mSurfaceControl).apply();
                }
            }
        }
@@ -875,7 +876,7 @@ class WindowStateAnimator {

        if (mSurfaceResized && (mAttrType == TYPE_BASE_APPLICATION) &&
            (task != null) && (task.getMainWindowSizeChangeTransaction() != null)) {
            mSurfaceController.deferTransactionUntil(mWin.getDeferTransactionBarrier(),
            mSurfaceController.deferTransactionUntil(mWin.getClientViewRootSurface(),
                    mWin.getFrameNumber());
            SurfaceControl.mergeToGlobalTransaction(task.getMainWindowSizeChangeTransaction());
            task.setMainWindowSizeChangeTransaction(null);
@@ -1012,7 +1013,7 @@ class WindowStateAnimator {
                        // the WS position is reset (so the stack position is shown) at the same
                        // time that the buffer size changes.
                        setOffsetPositionForStackResize(false);
                        mSurfaceController.deferTransactionUntil(mWin.getDeferTransactionBarrier(),
                        mSurfaceController.deferTransactionUntil(mWin.getClientViewRootSurface(),
                                mWin.getFrameNumber());
                    } else {
                        final ActivityStack stack = mWin.getRootTask();
@@ -1043,7 +1044,7 @@ class WindowStateAnimator {
        // comes in at the new size (normally position and crop are unfrozen).
        // deferTransactionUntil accomplishes this for us.
        if (wasForceScaled && !mForceScaleUntilResize) {
            mSurfaceController.deferTransactionUntil(mWin.getDeferTransactionBarrier(),
            mSurfaceController.deferTransactionUntil(mWin.getClientViewRootSurface(),
                    mWin.getFrameNumber());
            mSurfaceController.forceScaleableInTransaction(false);
        }
@@ -1288,7 +1289,8 @@ class WindowStateAnimator {
        if (mPendingDestroySurface != null && mDestroyPreservedSurfaceUponRedraw) {
            final SurfaceControl pendingSurfaceControl = mPendingDestroySurface.mSurfaceControl;
            mPostDrawTransaction.reparent(pendingSurfaceControl, null);
            mPostDrawTransaction.reparentChildren(pendingSurfaceControl,
            mPostDrawTransaction.reparentChildren(
                mPendingDestroySurface.getClientViewRootSurface(),
                mSurfaceController.mSurfaceControl);
        }

@@ -1521,10 +1523,10 @@ class WindowStateAnimator {
        mOffsetPositionForStackResize = offsetPositionForStackResize;
    }

    SurfaceControl getDeferTransactionBarrier() {
    SurfaceControl getClientViewRootSurface() {
        if (!hasSurface()) {
            return null;
        }
        return mSurfaceController.getDeferTransactionBarrier();
        return mSurfaceController.getClientViewRootSurface();
    }
}
Loading