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

Commit c5125f40 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Scale back up the task screenshot surface.

Fixes: 141340023
Test: Switch to another task in Overview in live tile mode, and make
sure the task screenshot upon recents animation is of the right size.

Change-Id: I209d43de48a2b952ce004acc748b52dab4f5080c
parent 42521834
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -38,8 +38,8 @@ class TaskScreenshotAnimatable implements SurfaceAnimator.Animatable {
    private int mWidth;
    private int mWidth;
    private int mHeight;
    private int mHeight;


    TaskScreenshotAnimatable(Function<SurfaceSession, SurfaceControl.Builder> surfaceControlFactory, Task task,
    TaskScreenshotAnimatable(Function<SurfaceSession, SurfaceControl.Builder> surfaceControlFactory,
            SurfaceControl.ScreenshotGraphicBuffer screenshotBuffer) {
            Task task, SurfaceControl.ScreenshotGraphicBuffer screenshotBuffer) {
        GraphicBuffer buffer = screenshotBuffer == null
        GraphicBuffer buffer = screenshotBuffer == null
                ? null : screenshotBuffer.getGraphicBuffer();
                ? null : screenshotBuffer.getGraphicBuffer();
        mTask = task;
        mTask = task;
@@ -58,6 +58,8 @@ class TaskScreenshotAnimatable implements SurfaceAnimator.Animatable {
            surface.copyFrom(mSurfaceControl);
            surface.copyFrom(mSurfaceControl);
            surface.attachAndQueueBufferWithColorSpace(buffer, screenshotBuffer.getColorSpace());
            surface.attachAndQueueBufferWithColorSpace(buffer, screenshotBuffer.getColorSpace());
            surface.release();
            surface.release();
            final float scale = 1.0f * mTask.getBounds().width() / mWidth;
            mSurfaceControl.setMatrix(scale, 0, 0, scale);
        }
        }
        getPendingTransaction().show(mSurfaceControl);
        getPendingTransaction().show(mSurfaceControl);
    }
    }