Merge "WindowManager: Move mGlobalScale application to WindowState"

This commit is contained in:
Rob Carr
2020-10-30 17:41:29 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 2 deletions

View File

@@ -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();

View File

@@ -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() {