Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java +11 −6 Original line number Diff line number Diff line Loading @@ -432,6 +432,11 @@ public class PipAnimationController { return !isOutPipDirection(mTransitionDirection); } boolean shouldApplyShadowRadius() { return !isOutPipDirection(mTransitionDirection) && !isRemovePipDirection(mTransitionDirection); } boolean inScaleTransition() { if (mAnimationType != ANIM_TYPE_BOUNDS) return false; final int direction = getTransitionDirection(); Loading Loading @@ -483,7 +488,7 @@ public class PipAnimationController { setCurrentValue(alpha); getSurfaceTransactionHelper().alpha(tx, leash, alpha) .round(tx, leash, shouldApplyCornerRadius()) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); tx.apply(); } Loading @@ -497,7 +502,7 @@ public class PipAnimationController { .resetScale(tx, leash, getDestinationBounds()) .crop(tx, leash, getDestinationBounds()) .round(tx, leash, shouldApplyCornerRadius()) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); tx.show(leash); tx.apply(); } Loading Loading @@ -585,7 +590,7 @@ public class PipAnimationController { getSurfaceTransactionHelper().crop(tx, leash, base) .scale(tx, leash, base, bounds, angle) .round(tx, leash, base, bounds) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); } } else { final Rect insets = computeInsets(fraction); Loading @@ -596,7 +601,7 @@ public class PipAnimationController { sourceBounds.inset(insets); getSurfaceTransactionHelper() .round(tx, leash, sourceBounds, bounds) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); } } if (!handlePipTransaction(leash, tx, bounds)) { Loading Loading @@ -649,7 +654,7 @@ public class PipAnimationController { if (shouldApplyCornerRadius()) { getSurfaceTransactionHelper() .round(tx, leash, sourceBounds, bounds) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); } tx.apply(); } Loading @@ -668,7 +673,7 @@ public class PipAnimationController { getSurfaceTransactionHelper() .alpha(tx, leash, 1f) .round(tx, leash, shouldApplyCornerRadius()) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); // TODO(b/178632364): this is a work around for the black background when // entering PiP in buttion navigation mode. if (isInPipDirection(direction)) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java +3 −2 Original line number Diff line number Diff line Loading @@ -206,8 +206,9 @@ public class PipSurfaceTransactionHelper { * Operates the shadow radius on a given transaction and leash * @return same {@link PipSurfaceTransactionHelper} instance for method chaining */ public PipSurfaceTransactionHelper shadow(SurfaceControl.Transaction tx, SurfaceControl leash) { tx.setShadowRadius(leash, mShadowRadius); public PipSurfaceTransactionHelper shadow(SurfaceControl.Transaction tx, SurfaceControl leash, boolean applyShadowRadius) { tx.setShadowRadius(leash, applyShadowRadius ? mShadowRadius : 0); return this; } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipAnimationController.java +11 −6 Original line number Diff line number Diff line Loading @@ -432,6 +432,11 @@ public class PipAnimationController { return !isOutPipDirection(mTransitionDirection); } boolean shouldApplyShadowRadius() { return !isOutPipDirection(mTransitionDirection) && !isRemovePipDirection(mTransitionDirection); } boolean inScaleTransition() { if (mAnimationType != ANIM_TYPE_BOUNDS) return false; final int direction = getTransitionDirection(); Loading Loading @@ -483,7 +488,7 @@ public class PipAnimationController { setCurrentValue(alpha); getSurfaceTransactionHelper().alpha(tx, leash, alpha) .round(tx, leash, shouldApplyCornerRadius()) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); tx.apply(); } Loading @@ -497,7 +502,7 @@ public class PipAnimationController { .resetScale(tx, leash, getDestinationBounds()) .crop(tx, leash, getDestinationBounds()) .round(tx, leash, shouldApplyCornerRadius()) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); tx.show(leash); tx.apply(); } Loading Loading @@ -585,7 +590,7 @@ public class PipAnimationController { getSurfaceTransactionHelper().crop(tx, leash, base) .scale(tx, leash, base, bounds, angle) .round(tx, leash, base, bounds) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); } } else { final Rect insets = computeInsets(fraction); Loading @@ -596,7 +601,7 @@ public class PipAnimationController { sourceBounds.inset(insets); getSurfaceTransactionHelper() .round(tx, leash, sourceBounds, bounds) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); } } if (!handlePipTransaction(leash, tx, bounds)) { Loading Loading @@ -649,7 +654,7 @@ public class PipAnimationController { if (shouldApplyCornerRadius()) { getSurfaceTransactionHelper() .round(tx, leash, sourceBounds, bounds) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); } tx.apply(); } Loading @@ -668,7 +673,7 @@ public class PipAnimationController { getSurfaceTransactionHelper() .alpha(tx, leash, 1f) .round(tx, leash, shouldApplyCornerRadius()) .shadow(tx, leash); .shadow(tx, leash, shouldApplyShadowRadius()); // TODO(b/178632364): this is a work around for the black background when // entering PiP in buttion navigation mode. if (isInPipDirection(direction)) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java +3 −2 Original line number Diff line number Diff line Loading @@ -206,8 +206,9 @@ public class PipSurfaceTransactionHelper { * Operates the shadow radius on a given transaction and leash * @return same {@link PipSurfaceTransactionHelper} instance for method chaining */ public PipSurfaceTransactionHelper shadow(SurfaceControl.Transaction tx, SurfaceControl leash) { tx.setShadowRadius(leash, mShadowRadius); public PipSurfaceTransactionHelper shadow(SurfaceControl.Transaction tx, SurfaceControl leash, boolean applyShadowRadius) { tx.setShadowRadius(leash, applyShadowRadius ? mShadowRadius : 0); return this; } Loading