From: Robert Carr Date: Wed, 27 Sep 2017 21:57:38 +0000 (-0700) Subject: Pull back app transform and screen rotation transform. X-Git-Tag: android-x86-9.0-r1~280^2~24 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=44643c1a5033544c3c0b102b96b38260a6e4f87e;p=android-x86%2Fframeworks-base.git Pull back app transform and screen rotation transform. App transform is removed in this CL for clarity but being re-added in Ifc83cbac281ce0654ecd8a1c2ca9c24a4d87c1d1. Test: go/wm-smoke Bug: 64674361 Change-Id: Idb7d7409a25cff518540077c9e189eba6d92dc43 --- diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index f45845752054..627af699f942 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -140,6 +140,7 @@ import android.util.DisplayMetrics; import android.util.MutableBoolean; import android.util.Slog; import android.util.proto.ProtoOutputStream; +import android.view.animation.Transformation; import android.view.Display; import android.view.DisplayInfo; import android.view.InputDevice; diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 0eabc898451a..1f2ab0733fd4 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -667,8 +667,6 @@ class WindowStateAnimator { } void computeShownFrameLocked() { - Transformation appTransformation = (mAppAnimator != null && mAppAnimator.hasTransformation) - ? mAppAnimator.transformation : null; final int displayId = mWin.getDisplayId(); final ScreenRotationAnimation screenRotationAnimation = @@ -677,14 +675,14 @@ class WindowStateAnimator { screenRotationAnimation != null && screenRotationAnimation.isAnimating(); mHasClipRect = false; - if (appTransformation != null || screenAnimation) { + if (screenAnimation) { // cache often used attributes locally final Rect frame = mWin.mFrame; final float tmpFloats[] = mService.mTmpFloats; final Matrix tmpMatrix = mWin.mTmpMatrix; // Compute the desired transformation. - if (screenAnimation && screenRotationAnimation.isRotating()) { + if (screenRotationAnimation.isRotating()) { // If we are doing a screen animation, the global rotation // applied to windows can result in windows that are carefully // aligned with each other to slightly separate, allowing you @@ -702,6 +700,7 @@ class WindowStateAnimator { } else { tmpMatrix.reset(); } + tmpMatrix.postScale(mWin.mGlobalScale, mWin.mGlobalScale); // WindowState.prepareSurfaces expands for surface insets (in order they don't get @@ -709,9 +708,6 @@ class WindowStateAnimator { tmpMatrix.postTranslate(mWin.mXOffset + mWin.mAttrs.surfaceInsets.left, mWin.mYOffset + mWin.mAttrs.surfaceInsets.top); - if (appTransformation != null) { - tmpMatrix.postConcat(appTransformation.getMatrix()); - } // "convert" it into SurfaceFlinger's format // (a 2x2 matrix + an offset) @@ -740,24 +736,6 @@ class WindowStateAnimator { || (mWin.isIdentityMatrix(mDsDx, mDtDx, mDtDy, mDsDy) && x == frame.left && y == frame.top))) { //Slog.i(TAG_WM, "Applying alpha transform"); - if (appTransformation != null) { - mShownAlpha *= appTransformation.getAlpha(); - if (appTransformation.hasClipRect()) { - mClipRect.set(appTransformation.getClipRect()); - mHasClipRect = true; - // The app transformation clip will be in the coordinate space of the main - // activity window, which the animation correctly assumes will be placed at - // (0,0)+(insets) relative to the containing frame. This isn't necessarily - // true for child windows though which can have an arbitrary frame position - // relative to their containing frame. We need to offset the difference - // between the containing frame as used to calculate the crop and our - // bounds to compensate for this. - if (mWin.layoutInParentFrame()) { - mClipRect.offset( (mWin.mContainingFrame.left - mWin.mFrame.left), - mWin.mContainingFrame.top - mWin.mFrame.top ); - } - } - } if (screenAnimation) { mShownAlpha *= screenRotationAnimation.getEnterTransformation().getAlpha(); } @@ -768,7 +746,6 @@ class WindowStateAnimator { if ((DEBUG_ANIM || WindowManagerService.localLOGV) && (mShownAlpha == 1.0 || mShownAlpha == 0.0)) Slog.v( TAG, "computeShownFrameLocked: Animating " + this + " mAlpha=" + mAlpha - + " app=" + (appTransformation == null ? "null" : appTransformation.getAlpha()) + " screen=" + (screenAnimation ? screenRotationAnimation.getEnterTransformation().getAlpha() : "null")); return;