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

Commit f7e00dbd authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Fixed issue with artifacts during scale-up transition animation" into mnc-dev

parents ebbc891a b3eba814
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -1277,6 +1277,7 @@ class WindowStateAnimator {
        if (displayContent == null) {
            return;
        }
        final DisplayInfo displayInfo = displayContent.getDisplayInfo();

        // Need to recompute a new system decor rect each time.
        if ((w.mAttrs.flags & LayoutParams.FLAG_SCALED) != 0) {
@@ -1286,7 +1287,6 @@ class WindowStateAnimator {
        } else if (!w.isDefaultDisplay()) {
            // On a different display there is no system decor.  Crop the window
            // by the screen boundaries.
            final DisplayInfo displayInfo = displayContent.getDisplayInfo();
            w.mSystemDecorRect.set(0, 0, w.mCompatFrame.width(), w.mCompatFrame.height());
            w.mSystemDecorRect.intersect(-w.mCompatFrame.left, -w.mCompatFrame.top,
                    displayInfo.logicalWidth - w.mCompatFrame.left,
@@ -1308,9 +1308,11 @@ class WindowStateAnimator {
            applyDecorRect(w.mDecorFrame);
        }

        // By default, the clip rect is the system decor if the transformation doesn't specify one.
        final boolean fullscreen = w.isFullscreen(displayInfo.appWidth, displayInfo.appHeight);
        final Rect clipRect = mTmpClipRect;
        clipRect.set((mHasClipRect) ? mClipRect : w.mSystemDecorRect);
        // We use the clip rect as provided by the tranformation for non-fullscreen windows to
        // avoid premature clipping with the system decor rect.
        clipRect.set((mHasClipRect && !fullscreen) ? mClipRect : w.mSystemDecorRect);

        // Expand the clip rect for surface insets.
        final WindowManager.LayoutParams attrs = w.mAttrs;
@@ -1319,6 +1321,13 @@ class WindowStateAnimator {
        clipRect.right += attrs.surfaceInsets.right;
        clipRect.bottom += attrs.surfaceInsets.bottom;

        if (mHasClipRect && fullscreen) {
            // We intersect the clip rect specified by the transformation with the expanded system
            // decor rect to prevent artifacts from drawing during animation if the transformation
            // clip rect extends outside the system decor rect.
            clipRect.intersect(mClipRect);
        }

        // The clip rect was generated assuming (0,0) as the window origin,
        // so we need to translate to match the actual surface coordinates.
        clipRect.offset(attrs.surfaceInsets.left, attrs.surfaceInsets.top);