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

Commit 8a197a4e authored by Craig Mautner's avatar Craig Mautner
Browse files

Fix dark flash when transition ends.

The DimSurface layer was momentarily being placed above the entering
app animtion. This lets the layering be set after the animations have
been evaluated.

Plus debug enhancements.

Change-Id: Icc034bc5264ae9bc6c57c593534683b56588b59a
parent bdb1c406
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class AppWindowAnimator {

    public void setAnimation(Animation anim, boolean initialized) {
        if (WindowManagerService.localLOGV) Slog.v(
            TAG, "Setting animation in " + this + ": " + anim);
            TAG, "Setting animation in " + mAppToken + ": " + anim);
        animation = anim;
        animating = false;
        animInitialized = initialized;
@@ -81,7 +81,7 @@ public class AppWindowAnimator {
    public void setDummyAnimation() {
        if (animation == null) {
            if (WindowManagerService.localLOGV) Slog.v(
                TAG, "Setting dummy animation in " + this);
                TAG, "Setting dummy animation in " + mAppToken);
            animation = sDummyAnimation;
            animInitialized = false;
        }
@@ -165,12 +165,12 @@ public class AppWindowAnimator {
        transformation.clear();
        final boolean more = animation.getTransformation(currentTime, transformation);
        if (WindowManagerService.DEBUG_ANIM) Slog.v(
            TAG, "Stepped animation in " + this + ": more=" + more + ", xform=" + transformation);
            TAG, "Stepped animation in " + mAppToken + ": more=" + more + ", xform=" + transformation);
        if (!more) {
            animation = null;
            clearThumbnail();
            if (WindowManagerService.DEBUG_ANIM) Slog.v(
                TAG, "Finished animation in " + this + " @ " + currentTime);
                TAG, "Finished animation in " + mAppToken + " @ " + currentTime);
        }
        hasTransformation = more;
        return more;
@@ -195,7 +195,7 @@ public class AppWindowAnimator {
                    && animation != null) {
                if (!animating) {
                    if (WindowManagerService.DEBUG_ANIM) Slog.v(
                        TAG, "Starting animation in " + this +
                        TAG, "Starting animation in " + mAppToken +
                        " @ " + currentTime + ": dw=" + dw + " dh=" + dh
                        + " scale=" + mService.mTransitionAnimationScale
                        + " allDrawn=" + mAppToken.allDrawn + " animating=" + animating);
@@ -248,7 +248,7 @@ public class AppWindowAnimator {
        }

        if (WindowManagerService.DEBUG_ANIM) Slog.v(
                TAG, "Animation done in " + this
                TAG, "Animation done in " + mAppToken
                + ": reportedVisible=" + mAppToken.reportedVisible);

        transformation.clear();
+8 −1
Original line number Diff line number Diff line
@@ -33,10 +33,17 @@ class DimSurface {
    DimSurface(SurfaceSession session) {
        if (mDimSurface == null) {
            try {
                if (WindowManagerService.DEBUG_SURFACE_TRACE) {
                    mDimSurface = new WindowStateAnimator.SurfaceTrace(session, 0,
                        "DimSurface",
                        -1, 16, 16, PixelFormat.OPAQUE,
                        Surface.FX_SURFACE_DIM);
                } else {
                    mDimSurface = new Surface(session, 0,
                        "DimSurface",
                        -1, 16, 16, PixelFormat.OPAQUE,
                        Surface.FX_SURFACE_DIM);
                }
                if (WindowManagerService.SHOW_TRANSACTIONS ||
                        WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
                                "  DIM " + mDimSurface + ": CREATE");
+1 −1
Original line number Diff line number Diff line
@@ -451,9 +451,9 @@ public class WindowAnimator {
        Surface.openTransaction();

        try {
            testWallpaperAndBackgroundLocked();
            updateWindowsAppsAndRotationAnimationsLocked();
            performAnimationsLocked();
            testWallpaperAndBackgroundLocked();

            // THIRD LOOP: Update the surfaces of all windows.