diff options
| author | 2018-04-30 17:54:53 -0700 | |
|---|---|---|
| committer | 2018-05-03 12:36:34 -0700 | |
| commit | 24be9ab639465226127c1af2eb701c17dbfe2aab (patch) | |
| tree | a00048877505a20fe76ac4111649fce65e186723 | |
| parent | 9411ab158935bbcf4ace5c8b881b9af977990c2b (diff) | |
WindowManager: Reapply magnification spec when adding windows.
Previously the magnification spec was effectively reapplied on each
frame when preparing surfaces. Following the migration to the hierarchy
it was thought this wasn't needed since parent hierarchy layers
would be magnified and Surfaces would receive them as they came and went.
It didn't end up quite so hunky-dory. While the app layer is magnified in whole,
the non app layer relies on magnification of individual windows to avoid magnifying
the navigation bar. Simply put this means we need to reapply magnification
when adding windows in addition to when the magnification spec changes.
Bug: 74221620
Test: Manual
Change-Id: Ifd17ecc837a9aa611ddc29e87aa95d2854b2af8e
| -rw-r--r-- | services/core/java/com/android/server/wm/DisplayContent.java | 14 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 38fb30e855e3..9621eddc348a 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -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 diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 86aed47a3482..0de3c921735e 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -808,6 +808,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP void onParentSet() { super.onParentSet(); setDrawnStateEvaluated(false /*evaluated*/); + + getDisplayContent().reapplyMagnificationSpec(); } @Override |