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

Commit dd03b9a2 authored by Chia-I Wu's avatar Chia-I Wu Committed by Luca Stefani
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
Merged-In: I5a0e2158d114a6e06c8241b48d90bbb6172216cc
parent 32d2b5f9
Loading
Loading
Loading
Loading
+5 −23
Original line number Diff line number Diff line
@@ -4909,9 +4909,6 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& display, sp<GraphicBuf
            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;
        }
@@ -4919,7 +4916,6 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& display, sp<GraphicBuf
            reqHeight = height;
        }
    }
    }

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

@@ -5169,20 +5165,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);