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

Commit 65dc7eef authored by Dan Stoza's avatar Dan Stoza
Browse files

SF: Swap w/h when capturing rotated screenshots

Swaps width and height when capturing a screenshot that is rotated by
90 or 270 degrees.

Bug: 8433742
Change-Id: Ibf0b604f541e3cc271e56fe0ad04dc366beb5d79
(cherry picked from commit 35024162)
parent 5ab3ba1e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3266,8 +3266,12 @@ status_t SurfaceFlinger::captureScreenImplLocked(
    ATRACE_CALL();

    // get screen geometry
    const uint32_t hw_w = hw->getWidth();
    const uint32_t hw_h = hw->getHeight();
    uint32_t hw_w = hw->getWidth();
    uint32_t hw_h = hw->getHeight();

    if (rotation & Transform::ROT_90) {
        std::swap(hw_w, hw_h);
    }

    if ((reqWidth > hw_w) || (reqHeight > hw_h)) {
        ALOGE("size mismatch (%d, %d) > (%d, %d)",