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

Commit 21fab752 authored by Alec Mouri's avatar Alec Mouri
Browse files

[SurfaceFlinger] Fix screenshot orientation in landscape

Change I0f7db422399985a1ff17da3faa946ff0943e58f7 defined a reverse
mapping for use by screenshots, e.g. a 90 degree rotation would be
passed down to SurfaceFlinger as 270 degrees. Change
I644bff547bed7d24284b8a6e7899a567d1f4cddf accidentally removed this
mapping, so adding it back into SurfaceFlinger.

Bug: 133849373
Test: adb screencap when phone is in landscape
Change-Id: I9d12551587307fa9f8028e78649545064051b46e
parent 4f65d337
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -5606,6 +5606,11 @@ status_t SurfaceFlinger::captureScreen(uint64_t displayOrLayerStack, Dataspace*

        captureOrientation = fromSurfaceComposerRotation(
                static_cast<ISurfaceComposer::Rotation>(display->getOrientation()));
        if (captureOrientation == ui::Transform::orientation_flags::ROT_90) {
            captureOrientation = ui::Transform::orientation_flags::ROT_270;
        } else if (captureOrientation == ui::Transform::orientation_flags::ROT_270) {
            captureOrientation = ui::Transform::orientation_flags::ROT_90;
        }
        *outDataspace =
                pickDataspaceFromColorMode(display->getCompositionDisplay()->getState().colorMode);
    }