Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32fed966 authored by Qiushi Han's avatar Qiushi Han
Browse files

Fix window animation flash issue

The original logic cuts down the mShownPosition, causing 1 pixel offset,
sometimes this will cause flash.

To fix this, Use Math.round() instead.

google issue:
https://code.google.com/p/android/issues/detail?id=224185

Change-Id: I8a2fe55a2df6eaa9eda4ba78966a74ea492ab8ea
parent e3d5fa10
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1033,7 +1033,7 @@ class WindowStateAnimator {
            mDtDy = tmpFloats[Matrix.MSCALE_Y];
            float x = tmpFloats[Matrix.MTRANS_X];
            float y = tmpFloats[Matrix.MTRANS_Y];
            mWin.mShownPosition.set((int) x, (int) y);
            mWin.mShownPosition.set(Math.round(x), Math.round(y));

            // Now set the alpha...  but because our current hardware
            // can't do alpha transformation on a non-opaque surface,
@@ -1129,7 +1129,7 @@ class WindowStateAnimator {
            mDtDy = tmpFloats[Matrix.MSCALE_Y];
            float x = tmpFloats[Matrix.MTRANS_X];
            float y = tmpFloats[Matrix.MTRANS_Y];
            mWin.mShownPosition.set((int) x, (int) y);
            mWin.mShownPosition.set(Math.round(x), Math.round(y));

            mShownAlpha = mAlpha;
        } else {