diff options
| author | 2015-06-19 20:45:05 +0000 | |
|---|---|---|
| committer | 2015-06-19 20:45:05 +0000 | |
| commit | 9e23ef2186aa9e1ce4fc209128cd006a24df2dff (patch) | |
| tree | 243c7a8d5f07da122dcf3d6a10c6ba2f4b2905b0 | |
| parent | 26c0b5e31294d4dce13379bc9bccaf555fe1e6c2 (diff) | |
| parent | 5acb30de6f65ff9ab47138b022a724ec489bdd9d (diff) | |
am 5acb30de: Merge "Apply the scale to surfaceinsets when computing crop region"
* commit '5acb30de6f65ff9ab47138b022a724ec489bdd9d':
Apply the scale to surfaceinsets when computing crop region
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowStateAnimator.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 1b5d0b8778ab..91e422f1de22 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -1417,10 +1417,21 @@ class WindowStateAnimator { // Adjust for surface insets. final LayoutParams attrs = w.getAttrs(); - width += attrs.surfaceInsets.left + attrs.surfaceInsets.right; - height += attrs.surfaceInsets.top + attrs.surfaceInsets.bottom; - left -= attrs.surfaceInsets.left; - top -= attrs.surfaceInsets.top; + final int displayId = w.getDisplayId(); + float scale = 1.0f; + // Magnification is supported only for the default display. + if (mService.mAccessibilityController != null && displayId == Display.DEFAULT_DISPLAY) { + MagnificationSpec spec = + mService.mAccessibilityController.getMagnificationSpecForWindowLocked(w); + if (spec != null && !spec.isNop()) { + scale = spec.scale; + } + } + + width += scale * (attrs.surfaceInsets.left + attrs.surfaceInsets.right); + height += scale * (attrs.surfaceInsets.top + attrs.surfaceInsets.bottom); + left -= scale * attrs.surfaceInsets.left; + top -= scale * attrs.surfaceInsets.top; final boolean surfaceMoved = mSurfaceX != left || mSurfaceY != top; if (surfaceMoved) { |