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

Commit fa8cba81 authored by Winson Chung's avatar Winson Chung
Browse files

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
parent f6cfa652
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;
+2 −4
Original line number Diff line number Diff line
@@ -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.
+1 −2
Original line number Diff line number Diff line
@@ -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));
                }