Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java +9 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,15 @@ public class PipSurfaceTransactionHelper { public PipSurfaceTransactionHelper shadow(SurfaceControl.Transaction tx, SurfaceControl leash, boolean applyShadowRadius) { if (Flags.enablePipBoxShadows()) { // Override and disable elevation shadows set by freeform transition. // // PiP uses box shadows but freeform windows use // elevation shadows (i.e. setShadowRadius). // To avoid having double shadows applied, disable the shadows set by freeform. // // TODO(b/367464660): Remove this once freeform box shadows are enabled tx.setShadowRadius(leash, 0); if (applyShadowRadius) { tx.setBoxShadowSettings(leash, mBoxShadowSettings); tx.setBorderSettings(leash, mBorderSettings); Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip2/PipSurfaceTransactionHelper.java +9 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,15 @@ public class PipSurfaceTransactionHelper implements PipDisplayLayoutState.Displa public PipSurfaceTransactionHelper shadow(SurfaceControl.Transaction tx, SurfaceControl leash, boolean applyShadowRadius) { if (Flags.enablePipBoxShadows()) { // Override and disable elevation shadows set by freeform transition. // // PiP uses box shadows but freeform windows use // elevation shadows (i.e. setShadowRadius). // To avoid having double shadows applied, disable the shadows set by freeform. // // TODO(b/367464660): Remove this once freeform box shadows are enabled tx.setShadowRadius(leash, 0); if (applyShadowRadius) { tx.setBoxShadowSettings(leash, mBoxShadowSettings); tx.setBorderSettings(leash, mBorderSettings); Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip2/PipSurfaceTransactionHelperTest.java +6 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyFloat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.intThat; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading Loading @@ -208,7 +207,8 @@ public class PipSurfaceTransactionHelperTest { verify(mMockTransaction).setBoxShadowSettings(eq(mTestLeash), boxShadow.capture()); verify(mMockTransaction).setBorderSettings(eq(mTestLeash), border.capture()); verify(mMockTransaction, never()).setShadowRadius(any(), anyFloat()); // Ensure that box shadow clears elevation shadow which may be set by window decorations. verify(mMockTransaction).setShadowRadius(eq(mTestLeash), eq(0.0f)); assertEquals(0, boxShadow.getValue().boxShadows.length); assertEquals(0, border.getValue().strokeWidth, 0.0); Loading @@ -227,7 +227,8 @@ public class PipSurfaceTransactionHelperTest { verify(mMockTransaction).setBoxShadowSettings(eq(mTestLeash), eq(mDarkBoxShadowSettings)); verify(mMockTransaction).setBorderSettings(eq(mTestLeash), eq(mDarkBorderSettings)); verify(mMockTransaction, never()).setShadowRadius(any(), anyFloat()); // Ensure that box shadow clears elevation shadow which may be set by window decorations. verify(mMockTransaction).setShadowRadius(eq(mTestLeash), eq(0.0f)); } Loading @@ -243,7 +244,8 @@ public class PipSurfaceTransactionHelperTest { verify(mMockTransaction).setBoxShadowSettings(eq(mTestLeash), eq(mLightBoxShadowSettings)); verify(mMockTransaction).setBorderSettings(eq(mTestLeash), eq(mLightBorderSettings)); verify(mMockTransaction, never()).setShadowRadius(any(), anyFloat()); // Ensure that box shadow clears elevation shadow which may be set by window decorations. verify(mMockTransaction).setShadowRadius(eq(mTestLeash), eq(0.0f)); } @Test Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java +9 −0 Original line number Diff line number Diff line Loading @@ -332,6 +332,15 @@ public class PipSurfaceTransactionHelper { public PipSurfaceTransactionHelper shadow(SurfaceControl.Transaction tx, SurfaceControl leash, boolean applyShadowRadius) { if (Flags.enablePipBoxShadows()) { // Override and disable elevation shadows set by freeform transition. // // PiP uses box shadows but freeform windows use // elevation shadows (i.e. setShadowRadius). // To avoid having double shadows applied, disable the shadows set by freeform. // // TODO(b/367464660): Remove this once freeform box shadows are enabled tx.setShadowRadius(leash, 0); if (applyShadowRadius) { tx.setBoxShadowSettings(leash, mBoxShadowSettings); tx.setBorderSettings(leash, mBorderSettings); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip2/PipSurfaceTransactionHelper.java +9 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,15 @@ public class PipSurfaceTransactionHelper implements PipDisplayLayoutState.Displa public PipSurfaceTransactionHelper shadow(SurfaceControl.Transaction tx, SurfaceControl leash, boolean applyShadowRadius) { if (Flags.enablePipBoxShadows()) { // Override and disable elevation shadows set by freeform transition. // // PiP uses box shadows but freeform windows use // elevation shadows (i.e. setShadowRadius). // To avoid having double shadows applied, disable the shadows set by freeform. // // TODO(b/367464660): Remove this once freeform box shadows are enabled tx.setShadowRadius(leash, 0); if (applyShadowRadius) { tx.setBoxShadowSettings(leash, mBoxShadowSettings); tx.setBorderSettings(leash, mBorderSettings); Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip2/PipSurfaceTransactionHelperTest.java +6 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyFloat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.intThat; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; Loading Loading @@ -208,7 +207,8 @@ public class PipSurfaceTransactionHelperTest { verify(mMockTransaction).setBoxShadowSettings(eq(mTestLeash), boxShadow.capture()); verify(mMockTransaction).setBorderSettings(eq(mTestLeash), border.capture()); verify(mMockTransaction, never()).setShadowRadius(any(), anyFloat()); // Ensure that box shadow clears elevation shadow which may be set by window decorations. verify(mMockTransaction).setShadowRadius(eq(mTestLeash), eq(0.0f)); assertEquals(0, boxShadow.getValue().boxShadows.length); assertEquals(0, border.getValue().strokeWidth, 0.0); Loading @@ -227,7 +227,8 @@ public class PipSurfaceTransactionHelperTest { verify(mMockTransaction).setBoxShadowSettings(eq(mTestLeash), eq(mDarkBoxShadowSettings)); verify(mMockTransaction).setBorderSettings(eq(mTestLeash), eq(mDarkBorderSettings)); verify(mMockTransaction, never()).setShadowRadius(any(), anyFloat()); // Ensure that box shadow clears elevation shadow which may be set by window decorations. verify(mMockTransaction).setShadowRadius(eq(mTestLeash), eq(0.0f)); } Loading @@ -243,7 +244,8 @@ public class PipSurfaceTransactionHelperTest { verify(mMockTransaction).setBoxShadowSettings(eq(mTestLeash), eq(mLightBoxShadowSettings)); verify(mMockTransaction).setBorderSettings(eq(mTestLeash), eq(mLightBorderSettings)); verify(mMockTransaction, never()).setShadowRadius(any(), anyFloat()); // Ensure that box shadow clears elevation shadow which may be set by window decorations. verify(mMockTransaction).setShadowRadius(eq(mTestLeash), eq(0.0f)); } @Test Loading