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

Commit f117ea5f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes I28ac9a2d,I8ecc88b6 into sc-dev am: 6b2d6fbe

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14096232

Change-Id: Ibbab6d0f643f95e3f9752b7767df2dace7d5729c
parents 8b0ad261 6b2d6fbe
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -193,6 +193,12 @@
      "group": "WM_ERROR",
      "group": "WM_ERROR",
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
      "at": "com\/android\/server\/wm\/WindowManagerService.java"
    },
    },
    "-1906387645": {
      "message": "SURFACE controller=%s alpha=%f HScale=%f, VScale=%f: %s",
      "level": "INFO",
      "group": "WM_SHOW_TRANSACTIONS",
      "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
    },
    "-1905191109": {
    "-1905191109": {
      "message": "SyncGroup %d: Finished!",
      "message": "SyncGroup %d: Finished!",
      "level": "VERBOSE",
      "level": "VERBOSE",
@@ -3283,12 +3289,6 @@
      "group": "WM_DEBUG_ORIENTATION",
      "group": "WM_DEBUG_ORIENTATION",
      "at": "com\/android\/server\/wm\/ActivityRecord.java"
      "at": "com\/android\/server\/wm\/ActivityRecord.java"
    },
    },
    "1747941491": {
      "message": "SURFACE controller=%s alpha=%f matrix=[%f*%f,%f*%f][%f*%f,%f*%f]: %s",
      "level": "INFO",
      "group": "WM_SHOW_TRANSACTIONS",
      "at": "com\/android\/server\/wm\/WindowStateAnimator.java"
    },
    "1756082882": {
    "1756082882": {
      "message": "Orientation change skips hidden %s",
      "message": "Orientation change skips hidden %s",
      "level": "VERBOSE",
      "level": "VERBOSE",
+11 −8
Original line number Original line Diff line number Diff line
@@ -5185,10 +5185,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     * @param outMatrix Matrix to fill in the transformation.
     * @param outMatrix Matrix to fill in the transformation.
     */
     */
    void getTransformationMatrix(float[] float9, Matrix outMatrix) {
    void getTransformationMatrix(float[] float9, Matrix outMatrix) {
        float9[Matrix.MSCALE_X] = mWinAnimator.mDsDx;
        float9[Matrix.MSCALE_X] = mGlobalScale;
        float9[Matrix.MSKEW_Y] = mWinAnimator.mDtDx;
        float9[Matrix.MSKEW_Y] = 0;
        float9[Matrix.MSKEW_X] = mWinAnimator.mDtDy;
        float9[Matrix.MSKEW_X] = 0;
        float9[Matrix.MSCALE_Y] = mWinAnimator.mDsDy;
        float9[Matrix.MSCALE_Y] = mGlobalScale;
        transformSurfaceInsetsPosition(mTmpPoint, mAttrs.surfaceInsets);
        transformSurfaceInsetsPosition(mTmpPoint, mAttrs.surfaceInsets);
        int x = mSurfacePosition.x + mTmpPoint.x;
        int x = mSurfacePosition.x + mTmpPoint.x;
        int y = mSurfacePosition.y + mTmpPoint.y;
        int y = mSurfacePosition.y + mTmpPoint.y;
@@ -5364,11 +5364,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        }
        }
    }
    }


    private void updateGlobalScaleIfNeeded() {
    private void updateScaleIfNeeded() {
        if (mLastGlobalScale != mGlobalScale) {
        if (mLastGlobalScale != mGlobalScale || mLastHScale != mHScale ||
            mLastVScale != mVScale ) {
            getPendingTransaction().setMatrix(getSurfaceControl(),
            getPendingTransaction().setMatrix(getSurfaceControl(),
                mGlobalScale, 0, 0, mGlobalScale);
                mGlobalScale*mHScale, 0, 0, mGlobalScale*mVScale);
            mLastGlobalScale = mGlobalScale;
            mLastGlobalScale = mGlobalScale;
            mLastHScale = mHScale;
            mLastVScale = mVScale;
        }
        }
    }
    }


@@ -5379,7 +5382,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        updateSurfacePositionNonOrganized();
        updateSurfacePositionNonOrganized();
        // Send information to SurfaceFlinger about the priority of the current window.
        // Send information to SurfaceFlinger about the priority of the current window.
        updateFrameRateSelectionPriorityIfNeeded();
        updateFrameRateSelectionPriorityIfNeeded();
        if (isVisibleRequested()) updateGlobalScaleIfNeeded();
        if (isVisibleRequested()) updateScaleIfNeeded();


        mWinAnimator.prepareSurfaceLocked(getSyncTransaction());
        mWinAnimator.prepareSurfaceLocked(getSyncTransaction());
        super.prepareSurfaces();
        super.prepareSurfaces();
+8 −48
Original line number Original line Diff line number Diff line
@@ -125,11 +125,6 @@ class WindowStateAnimator {
     */
     */
    private final Rect mSystemDecorRect = new Rect();
    private final Rect mSystemDecorRect = new Rect();


    float mDsDx=1, mDtDx=0, mDsDy=0, mDtDy=1;
    private float mLastDsDx=1, mLastDtDx=0, mLastDsDy=0, mLastDtDy=1;

    boolean mHaveMatrix;

    // Set to true if, when the window gets displayed, it should perform
    // Set to true if, when the window gets displayed, it should perform
    // an enter animation.
    // an enter animation.
    boolean mEnterAnimationPending;
    boolean mEnterAnimationPending;
@@ -478,11 +473,6 @@ class WindowStateAnimator {
        }
        }


        mShownAlpha = mAlpha;
        mShownAlpha = mAlpha;
        mHaveMatrix = false;
        mDsDx = 1;
        mDtDx = 0;
        mDtDy = 0;
        mDsDy = 1;
    }
    }


    private boolean isInBlastSync() {
    private boolean isInBlastSync() {
@@ -519,13 +509,6 @@ class WindowStateAnimator {
            int yOffset = mYOffset;
            int yOffset = mYOffset;
            if (!mIsWallpaper) {
            if (!mIsWallpaper) {
                mSurfaceController.setPosition(t, xOffset, yOffset);
                mSurfaceController.setPosition(t, xOffset, yOffset);
                // Wallpaper is already updated above when calling setWallpaperPositionAndScale so
                // we only need to consider the non-wallpaper case here.
                mSurfaceController.setMatrix(t,
                        mDsDx * w.mHScale,
                        mDtDx * w.mVScale,
                        mDtDy * w.mHScale,
                        mDsDy * w.mVScale);
            } else {
            } else {
                setWallpaperPositionAndScale(t, xOffset, yOffset, mWallpaperScale);
                setWallpaperPositionAndScale(t, xOffset, yOffset, mWallpaperScale);
            }
            }
@@ -585,25 +568,12 @@ class WindowStateAnimator {
                        "Orientation change skips hidden %s", w);
                        "Orientation change skips hidden %s", w);
            }
            }
        } else if (mLastAlpha != mShownAlpha
        } else if (mLastAlpha != mShownAlpha
                || mLastDsDx != mDsDx
                || mLastDtDx != mDtDx
                || mLastDsDy != mDsDy
                || mLastDtDy != mDtDy
                || w.mLastHScale != w.mHScale
                || w.mLastVScale != w.mVScale
                || mLastHidden) {
                || mLastHidden) {
            displayed = true;
            displayed = true;
            mLastAlpha = mShownAlpha;
            mLastAlpha = mShownAlpha;
            mLastDsDx = mDsDx;
            mLastDtDx = mDtDx;
            mLastDsDy = mDsDy;
            mLastDtDy = mDtDy;
            w.mLastHScale = w.mHScale;
            w.mLastVScale = w.mVScale;
            ProtoLog.i(WM_SHOW_TRANSACTIONS,
            ProtoLog.i(WM_SHOW_TRANSACTIONS,
                    "SURFACE controller=%s alpha=%f matrix=[%f*%f,%f*%f][%f*%f,%f*%f]: %s",
                    "SURFACE controller=%s alpha=%f HScale=%f, VScale=%f: %s",
                            mSurfaceController, mShownAlpha, mDsDx, w.mHScale, mDtDx, w.mVScale,
                    mSurfaceController, mShownAlpha, w.mHScale, w.mVScale, w);
                            mDtDy, w.mHScale, mDsDy, w.mVScale, w);


            boolean prepared = true;
            boolean prepared = true;


@@ -611,12 +581,7 @@ class WindowStateAnimator {
                setWallpaperPositionAndScale(t, mXOffset, mYOffset, mWallpaperScale);
                setWallpaperPositionAndScale(t, mXOffset, mYOffset, mWallpaperScale);
            } else {
            } else {
                prepared =
                prepared =
                    mSurfaceController.prepareToShowInTransaction(t, mShownAlpha,
                    mSurfaceController.prepareToShowInTransaction(t, mShownAlpha);
                        mDsDx * w.mHScale,
                        mDtDx * w.mVScale,
                        mDtDy * w.mHScale,
                        mDsDy * w.mVScale
                    );
            }
            }


            if (prepared && mDrawState == HAS_DRAWN) {
            if (prepared && mDrawState == HAS_DRAWN) {
@@ -711,11 +676,10 @@ class WindowStateAnimator {


        mSurfaceController.setPosition(t,mWin.mTmpMatrixArray[MTRANS_X],
        mSurfaceController.setPosition(t,mWin.mTmpMatrixArray[MTRANS_X],
                mWin.mTmpMatrixArray[MTRANS_Y]);
                mWin.mTmpMatrixArray[MTRANS_Y]);
        mSurfaceController.setMatrix(t,
        mSurfaceController.setMatrix(t, mWin.mTmpMatrixArray[MSCALE_X],
                mDsDx * mWin.mTmpMatrixArray[MSCALE_X] * mWin.mHScale,
            mWin.mTmpMatrixArray[MSKEW_Y],
                mDtDx * mWin.mTmpMatrixArray[MSKEW_Y] * mWin.mVScale,
            mWin.mTmpMatrixArray[MSKEW_X],
                mDtDy * mWin.mTmpMatrixArray[MSKEW_X] * mWin.mHScale,
            mWin.mTmpMatrixArray[MSCALE_Y]);
                mDsDy * mWin.mTmpMatrixArray[MSCALE_Y] * mWin.mVScale);
    }
    }


    /**
    /**
@@ -917,12 +881,8 @@ class WindowStateAnimator {
                    pw.print(" mAlpha="); pw.print(mAlpha);
                    pw.print(" mAlpha="); pw.print(mAlpha);
                    pw.print(" mLastAlpha="); pw.println(mLastAlpha);
                    pw.print(" mLastAlpha="); pw.println(mLastAlpha);
        }
        }
        if (mHaveMatrix || mWin.mGlobalScale != 1) {
        if (mWin.mGlobalScale != 1) {
            pw.print(prefix); pw.print("mGlobalScale="); pw.print(mWin.mGlobalScale);
            pw.print(prefix); pw.print("mGlobalScale="); pw.print(mWin.mGlobalScale);
                    pw.print(" mDsDx="); pw.print(mDsDx);
                    pw.print(" mDtDx="); pw.print(mDtDx);
                    pw.print(" mDtDy="); pw.print(mDtDy);
                    pw.print(" mDsDy="); pw.println(mDsDy);
        }
        }
    }
    }


+1 −7
Original line number Original line Diff line number Diff line
@@ -178,19 +178,13 @@ class WindowSurfaceController {
        t.setMatrix(mSurfaceControl, dsdx, dtdx, dtdy, dsdy);
        t.setMatrix(mSurfaceControl, dsdx, dtdx, dtdy, dsdy);
    }
    }


    boolean prepareToShowInTransaction(SurfaceControl.Transaction t, float alpha, float dsdx,
    boolean prepareToShowInTransaction(SurfaceControl.Transaction t, float alpha) {
            float dtdx, float dsdy, float dtdy) {
        if (mSurfaceControl == null) {
        if (mSurfaceControl == null) {
            return false;
            return false;
        }
        }


        mSurfaceAlpha = alpha;
        mSurfaceAlpha = alpha;
        t.setAlpha(mSurfaceControl, alpha);
        t.setAlpha(mSurfaceControl, alpha);
        mLastDsdx = dsdx;
        mLastDtdx = dtdx;
        mLastDsdy = dsdy;
        mLastDtdy = dtdy;
        t.setMatrix(mSurfaceControl, dsdx, dtdx, dsdy, dtdy);
        return true;
        return true;
    }
    }