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

Commit 41e42254 authored by Robert Carr's avatar Robert Carr
Browse files

WindowManager: Move mGlobalScale application to WindowState

As part of the overall thrust to remove WindowState we move the
application of the so called "GlobalScale" to the WindowState level of
the hierarchy. The remaining matrix code code in WSA will be cleaned up
in a follow-up CL, but we are landing this step immediately to unblock
BLAST which would otherwise be fighting with WSA to set the scale on
the WSA SurfaceControl

Bug: 161937501
Bug: 171956715
Bug: 168506246
Test: Existing tests pass. Repro from bug with BLAST enabled.
Change-Id: I2e0b2619ce3625f1089bf8a9411a31afb959b35c
parent 7e3010b2
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -421,6 +421,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

    // Current transformation being applied.
    float mGlobalScale=1;
    float mLastGlobalScale=1;
    float mInvGlobalScale=1;
    float mHScale=1, mVScale=1;
    float mLastHScale=1, mLastVScale=1;
@@ -5301,6 +5302,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        }
    }

    private void updateGlobalScaleIfNeeded() {
        if (mLastGlobalScale != mGlobalScale) {
            getPendingTransaction().setMatrix(getSurfaceControl(),
                mGlobalScale, 0, 0, mGlobalScale);
            mLastGlobalScale = mGlobalScale;
        }
    }

    @Override
    void prepareSurfaces() {
        mIsDimming = false;
@@ -5308,6 +5317,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        updateSurfacePositionNonOrganized();
        // Send information to SufaceFlinger about the priority of the current window.
        updateFrameRateSelectionPriorityIfNeeded();
        updateGlobalScaleIfNeeded();

        mWinAnimator.prepareSurfaceLocked(SurfaceControl.getGlobalTransaction(), true);
        super.prepareSurfaces();
+2 −2
Original line number Diff line number Diff line
@@ -624,10 +624,10 @@ class WindowStateAnimator {

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

    private boolean shouldConsumeMainWindowSizeTransaction() {