Merge "WindowManager: Reapply magnification spec when adding windows." into pi-dev

This commit is contained in:
Rob Carr
2018-05-03 22:52:55 +00:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 0 deletions

View File

@@ -393,6 +393,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
/** Temporary float array to retrieve 3x3 matrix values. */
private final float[] mTmpFloats = new float[9];
private MagnificationSpec mMagnificationSpec;
private final Consumer<WindowState> mUpdateWindowsForAnimator = w -> {
WindowStateAnimator winAnimator = w.mWinAnimator;
final AppWindowToken atoken = w.mAppToken;
@@ -3837,10 +3839,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
}
void applyMagnificationSpec(MagnificationSpec spec) {
if (spec.scale != 1.0) {
mMagnificationSpec = spec;
} else {
mMagnificationSpec = null;
}
applyMagnificationSpec(getPendingTransaction(), spec);
getPendingTransaction().apply();
}
void reapplyMagnificationSpec() {
if (mMagnificationSpec != null) {
applyMagnificationSpec(getPendingTransaction(), mMagnificationSpec);
}
}
@Override
void onParentSet() {
// Since we are the top of the SurfaceControl hierarchy here

View File

@@ -808,6 +808,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
void onParentSet() {
super.onParentSet();
setDrawnStateEvaluated(false /*evaluated*/);
getDisplayContent().reapplyMagnificationSpec();
}
@Override