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

Commit 4487bb52 authored by Tyler Lacey's avatar Tyler Lacey Committed by Automerger Merge Worker
Browse files

Merge "Fix captureTaskBitmap for tasks not positioned at top-left of screen."...

Merge "Fix captureTaskBitmap for tasks not positioned at  top-left of screen." into tm-dev am: bf059af7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17056517

Change-Id: I1bbf023386729b6853a32ba03ff7227e4eb3f7fc
parents 12754e2b bf059af7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3934,7 +3934,13 @@ public class WindowManagerService extends IWindowManager.Stub
                return null;
            }

            // The bounds returned by the task represent the task's position on the screen. However,
            // we need to specify a crop relative to the task's surface control. Therefore, shift
            // the task's bounds to 0,0 so that we have the correct size and position within the
            // task's surface control.
            task.getBounds(mTmpRect);
            mTmpRect.offsetTo(0, 0);

            final SurfaceControl sc = task.getSurfaceControl();
            final SurfaceControl.ScreenshotHardwareBuffer buffer = SurfaceControl.captureLayers(
                    layerCaptureArgsBuilder.setLayer(sc).setSourceCrop(mTmpRect).build());