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

Commit d6684229 authored by Tiger Huang's avatar Tiger Huang Committed by android-build-merger
Browse files

Merge "Fix a bug about the z-order of layers caused by merging transactions"...

Merge "Fix a bug about the z-order of layers caused by merging transactions" into qt-dev am: 6e52f838
am: a741d7c8

Change-Id: I476e43d1a4be0cdf51d17e3abc1f76aa9c1bedf1
parents 70982e39 a741d7c8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2660,6 +2660,9 @@ public final class SurfaceControl implements Parcelable {
         */
        @NonNull
        public Transaction merge(@NonNull Transaction other) {
            if (this == other) {
                return this;
            }
            mResizedSurfaces.putAll(other.mResizedSurfaces);
            other.mResizedSurfaces.clear();
            nativeMergeTransaction(mNativeObject, other.mNativeObject);
+6 −6
Original line number Diff line number Diff line
@@ -2005,7 +2005,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        }
        layoutLetterbox(winHint);
        if (mLetterbox != null && mLetterbox.needsApplySurfaceChanges()) {
            mLetterbox.applySurfaceChanges(mPendingTransaction);
            mLetterbox.applySurfaceChanges(getPendingTransaction());
        }
    }

@@ -3059,13 +3059,13 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree

        if (mSurfaceControl != null) {
            if (show && !mLastSurfaceShowing) {
                mPendingTransaction.show(mSurfaceControl);
                getPendingTransaction().show(mSurfaceControl);
            } else if (!show && mLastSurfaceShowing) {
                mPendingTransaction.hide(mSurfaceControl);
                getPendingTransaction().hide(mSurfaceControl);
            }
        }
        if (mThumbnail != null) {
            mThumbnail.setShowing(mPendingTransaction, show);
            mThumbnail.setShowing(getPendingTransaction(), show);
        }
        mLastSurfaceShowing = show;
        super.prepareSurfaces();
@@ -3225,8 +3225,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree

    private void updateColorTransform() {
        if (mSurfaceControl != null && mLastAppSaturationInfo != null) {
            mPendingTransaction.setColorTransform(mSurfaceControl, mLastAppSaturationInfo.mMatrix,
                    mLastAppSaturationInfo.mTranslation);
            getPendingTransaction().setColorTransform(mSurfaceControl,
                    mLastAppSaturationInfo.mMatrix, mLastAppSaturationInfo.mTranslation);
            mWmService.scheduleAnimationLocked();
        }
    }
+12 −6
Original line number Diff line number Diff line
@@ -3339,7 +3339,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        final SurfaceControl newParent =
                shouldAttachToDisplay ? mWindowingLayer : computeImeParent();
        if (newParent != null) {
            mPendingTransaction.reparent(mImeWindowsContainers.mSurfaceControl, newParent);
            getPendingTransaction().reparent(mImeWindowsContainers.mSurfaceControl, newParent);
            scheduleAnimation();
        }
    }
@@ -3746,7 +3746,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            mPortalWindowHandle.touchableRegion.getBounds(mTmpRect);
            if (!mTmpBounds.equals(mTmpRect)) {
                mPortalWindowHandle.touchableRegion.set(mTmpBounds);
                mPendingTransaction.setInputWindowInfo(mParentSurfaceControl, mPortalWindowHandle);
                getPendingTransaction().setInputWindowInfo(
                        mParentSurfaceControl, mPortalWindowHandle);
            }
        }
    }
@@ -4834,18 +4835,23 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        try {
            final ScreenRotationAnimation screenRotationAnimation =
                    mWmService.mAnimator.getScreenRotationAnimationLocked(mDisplayId);
            final Transaction transaction = getPendingTransaction();
            if (screenRotationAnimation != null && screenRotationAnimation.isAnimating()) {
                screenRotationAnimation.getEnterTransformation().getMatrix().getValues(mTmpFloats);
                mPendingTransaction.setMatrix(mWindowingLayer,
                transaction.setMatrix(mWindowingLayer,
                        mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
                        mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
                mPendingTransaction.setPosition(mWindowingLayer,
                transaction.setPosition(mWindowingLayer,
                        mTmpFloats[Matrix.MTRANS_X], mTmpFloats[Matrix.MTRANS_Y]);
                mPendingTransaction.setAlpha(mWindowingLayer,
                transaction.setAlpha(mWindowingLayer,
                        screenRotationAnimation.getEnterTransformation().getAlpha());
            }

            super.prepareSurfaces();

            // TODO: Once we totally eliminate global transaction we will pass transaction in here
            //       rather than merging to global.
            SurfaceControl.mergeToGlobalTransaction(transaction);
        } finally {
            Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
        }
@@ -5001,7 +5007,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        if (mPortalWindowHandle == null) {
            mPortalWindowHandle = createPortalWindowHandle(sc.toString());
        }
        mPendingTransaction.setInputWindowInfo(sc, mPortalWindowHandle)
        getPendingTransaction().setInputWindowInfo(sc, mPortalWindowHandle)
                .reparent(mWindowingLayer, sc).reparent(mOverlayLayer, sc);
    }

+1 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ class Task extends WindowContainer<AppWindowToken> implements ConfigurationConta
        setOrientation(SCREEN_ORIENTATION_UNSET);
    }

    @Override
    DisplayContent getDisplayContent() {
        return mStack != null ? mStack.getDisplayContent() : null;
    }
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ class TaskScreenshotAnimatable implements SurfaceAnimator.Animatable {

    @Override
    public SurfaceControl.Transaction getPendingTransaction() {
        return mTask.mPendingTransaction;
        return mTask.getPendingTransaction();
    }

    @Override
Loading