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

Commit df488c13 authored by Merissa Mitchell's avatar Merissa Mitchell
Browse files

Enable rounded corners when PiP exits to fullscreen.

https://screenshot.googleplex.com/Abp88HonUde6WQJ
Recall: http://recall/clips/ffcdbc70-08c3-458b-85dc-05a08bed822c

Bug: 352772911
Test: atest WMShellFlickerTestsPip2
Flag: EXEMPT bug fix
Change-Id: I7eec91dec1ed0c0ba9b8bf01be6fc6ddcd41843d
parent 41f1a9f8
Loading
Loading
Loading
Loading
+12 −21
Original line number Diff line number Diff line
@@ -497,13 +497,8 @@ public class PipAnimationController {
            mCurrentValue = value;
        }

        boolean shouldApplyCornerRadius() {
            return !isOutPipDirection(mTransitionDirection);
        }

        boolean shouldApplyShadowRadius() {
            return !isOutPipDirection(mTransitionDirection)
                    && !isRemovePipDirection(mTransitionDirection);
            return !isRemovePipDirection(mTransitionDirection);
        }

        boolean inScaleTransition() {
@@ -556,7 +551,7 @@ public class PipAnimationController {
                    final float alpha = getStartValue() * (1 - fraction) + getEndValue() * fraction;
                    setCurrentValue(alpha);
                    getSurfaceTransactionHelper().alpha(tx, leash, alpha)
                            .round(tx, leash, shouldApplyCornerRadius())
                            .round(tx, leash, true /* applyCornerRadius */)
                            .shadow(tx, leash, shouldApplyShadowRadius());
                    if (!handlePipTransaction(leash, tx, destinationBounds, alpha)) {
                        tx.apply();
@@ -572,7 +567,7 @@ public class PipAnimationController {
                    getSurfaceTransactionHelper()
                            .resetScale(tx, leash, getDestinationBounds())
                            .crop(tx, leash, getDestinationBounds())
                            .round(tx, leash, shouldApplyCornerRadius())
                            .round(tx, leash, true /* applyCornerRadius */)
                            .shadow(tx, leash, shouldApplyShadowRadius());
                    tx.show(leash);
                    tx.apply();
@@ -686,14 +681,12 @@ public class PipAnimationController {
                        getSurfaceTransactionHelper().scaleAndCrop(tx, leash,
                                adjustedSourceRectHint, initialSourceValue, bounds, insets,
                                isInPipDirection, fraction);
                        if (shouldApplyCornerRadius()) {
                        final Rect sourceBounds = new Rect(initialContainerRect);
                        sourceBounds.inset(insets);
                        getSurfaceTransactionHelper()
                                .round(tx, leash, sourceBounds, bounds)
                                .shadow(tx, leash, shouldApplyShadowRadius());
                    }
                    }
                    if (!handlePipTransaction(leash, tx, bounds, /* alpha= */ 1f)) {
                        tx.apply();
                    }
@@ -741,11 +734,9 @@ public class PipAnimationController {
                            .rotateAndScaleWithCrop(tx, leash, initialContainerRect, bounds,
                                    insets, degree, x, y, isOutPipDirection,
                                    rotationDelta == ROTATION_270 /* clockwise */);
                    if (shouldApplyCornerRadius()) {
                    getSurfaceTransactionHelper()
                            .round(tx, leash, sourceBounds, bounds)
                            .shadow(tx, leash, shouldApplyShadowRadius());
                    }
                    if (!handlePipTransaction(leash, tx, bounds, 1f /* alpha */)) {
                        tx.apply();
                    }
@@ -761,7 +752,7 @@ public class PipAnimationController {
                void onStartTransaction(SurfaceControl leash, SurfaceControl.Transaction tx) {
                    getSurfaceTransactionHelper()
                            .alpha(tx, leash, 1f)
                            .round(tx, leash, shouldApplyCornerRadius())
                            .round(tx, leash, true /* applyCornerRadius */)
                            .shadow(tx, leash, shouldApplyShadowRadius());
                    tx.show(leash);
                    tx.apply();