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

Commit 5e3afa61 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

surfaceflinger: silence some RenderArea errors

Allow physical size and source crop size to be larger than the
logical size.

Bug: 113041375
Test: builds
Change-Id: I5a0e2158d114a6e06c8241b48d90bbb6172216cc
parent 38f38f38
Loading
Loading
Loading
Loading
+5 −23
Original line number Diff line number Diff line
@@ -5104,9 +5104,6 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& displayToken,
            std::swap(width, height);
        }

        if ((reqWidth > width) || (reqHeight > height)) {
            ALOGE("size mismatch (%d, %d) > (%d, %d)", reqWidth, reqHeight, width, height);
        } else {
        if (reqWidth == 0) {
            reqWidth = width;
        }
@@ -5114,7 +5111,6 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& displayToken,
            reqHeight = height;
        }
    }
    }

    DisplayRenderArea renderArea(display, sourceCrop, reqWidth, reqHeight, renderAreaRotation);

@@ -5366,20 +5362,6 @@ void SurfaceFlinger::renderScreenImplLocked(const RenderArea& renderArea,
        sourceCrop = tr.transform(sourceCrop);
    }

    // ensure that sourceCrop is inside screen
    if (sourceCrop.left < 0) {
        ALOGE("Invalid crop rect: l = %d (< 0)", sourceCrop.left);
    }
    if (sourceCrop.right > raWidth) {
        ALOGE("Invalid crop rect: r = %d (> %d)", sourceCrop.right, raWidth);
    }
    if (sourceCrop.top < 0) {
        ALOGE("Invalid crop rect: t = %d (< 0)", sourceCrop.top);
    }
    if (sourceCrop.bottom > raHeight) {
        ALOGE("Invalid crop rect: b = %d (> %d)", sourceCrop.bottom, raHeight);
    }

    // assume ColorMode::SRGB / RenderIntent::COLORIMETRIC
    engine.setOutputDataSpace(Dataspace::SRGB);
    engine.setDisplayMaxLuminance(DisplayDevice::sDefaultMaxLumiance);