Merge "Apply the scale to surfaceinsets when computing crop region" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
93297d2086
@@ -1383,10 +1383,21 @@ class WindowStateAnimator {
|
|||||||
|
|
||||||
// Adjust for surface insets.
|
// Adjust for surface insets.
|
||||||
final LayoutParams attrs = w.getAttrs();
|
final LayoutParams attrs = w.getAttrs();
|
||||||
width += attrs.surfaceInsets.left + attrs.surfaceInsets.right;
|
final int displayId = w.getDisplayId();
|
||||||
height += attrs.surfaceInsets.top + attrs.surfaceInsets.bottom;
|
float scale = 1.0f;
|
||||||
left -= attrs.surfaceInsets.left;
|
// Magnification is supported only for the default display.
|
||||||
top -= attrs.surfaceInsets.top;
|
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;
|
final boolean surfaceMoved = mSurfaceX != left || mSurfaceY != top;
|
||||||
if (surfaceMoved) {
|
if (surfaceMoved) {
|
||||||
|
|||||||
Reference in New Issue
Block a user