summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2024-04-24 22:26:40 +0000
committer Winson Chung <winsonc@google.com> 2024-04-25 15:14:31 +0000
commitfa8cba81cff0e8564340de15faf2a5271d94cbc0 (patch)
treeec41378bc9f9ffaff48de0e8366a3b14c542e080
parentf6cfa652e16e006e240b9a240b5bb9cca23cb94d (diff)
Use only the icon size for surface to draw the icon into
- The original change ag/16081867 repourposed OutlineManager which actually drew in the outline around each split task, but the SplitDecorManager only needs to draw the icon (the background is on another surface). This will also be obsolete once we migrate to/merge SplitDecorManager and ResizeVeil in the future. Bug: 335975211 Test: Take a perfetto trace and verify that the requested surface bounds correspond to the desired icon size Change-Id: Ib4fa8921ea114b32e54dc35a09e86bab6d838420
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java6
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java6
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java3
3 files changed, 6 insertions, 9 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
index dae62ac74483..25dc25e176d7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
@@ -109,7 +109,7 @@ public class SplitDecorManager extends WindowlessWindowManager {
}
/** Inflates split decor surface on the root surface. */
- public void inflate(Context context, SurfaceControl rootLeash, Rect rootBounds) {
+ public void inflate(Context context, SurfaceControl rootLeash) {
if (mIconLeash != null && mViewHost != null) {
return;
}
@@ -128,8 +128,8 @@ public class SplitDecorManager extends WindowlessWindowManager {
final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
0 /* width */, 0 /* height */, TYPE_APPLICATION_OVERLAY,
FLAG_NOT_FOCUSABLE | FLAG_NOT_TOUCHABLE, PixelFormat.TRANSLUCENT);
- lp.width = rootBounds.width();
- lp.height = rootBounds.height();
+ lp.width = mIconSize;
+ lp.height = mIconSize;
lp.token = new Binder();
lp.setTitle(TAG);
lp.privateFlags |= PRIVATE_FLAG_NO_MOVE_ANIMATION | PRIVATE_FLAG_TRUSTED_OVERLAY;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
index fadc9706af6a..4c68106af1fe 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
@@ -1762,10 +1762,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
void finishEnterSplitScreen(SurfaceControl.Transaction finishT) {
ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "finishEnterSplitScreen");
mSplitLayout.update(finishT, true /* resetImePosition */);
- mMainStage.getSplitDecorManager().inflate(mContext, mMainStage.mRootLeash,
- getMainStageBounds());
- mSideStage.getSplitDecorManager().inflate(mContext, mSideStage.mRootLeash,
- getSideStageBounds());
+ mMainStage.getSplitDecorManager().inflate(mContext, mMainStage.mRootLeash);
+ mSideStage.getSplitDecorManager().inflate(mContext, mSideStage.mRootLeash);
setDividerVisibility(true, finishT);
// Ensure divider surface are re-parented back into the hierarchy at the end of the
// transition. See Transition#buildFinishTransaction for more detail.
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
index f33ab33dafcc..f41bca36bb70 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
@@ -218,8 +218,7 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
// Inflates split decor view only when the root task is visible.
if (!ENABLE_SHELL_TRANSITIONS && mRootTaskInfo.isVisible != taskInfo.isVisible) {
if (taskInfo.isVisible) {
- mSplitDecorManager.inflate(mContext, mRootLeash,
- taskInfo.configuration.windowConfiguration.getBounds());
+ mSplitDecorManager.inflate(mContext, mRootLeash);
} else {
mSyncQueue.runInSync(t -> mSplitDecorManager.release(t));
}