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

Commit 89e1ec27 authored by Chia-I Wu's avatar Chia-I Wu Committed by Yiwei Zhang
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 946e37e7
Loading
Loading
Loading
Loading
+5 −23
Original line number Diff line number Diff line
@@ -4885,9 +4885,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;
        }
@@ -4895,7 +4892,6 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& display, sp<GraphicBuf
            reqHeight = height;
        }
    }
    }

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

@@ -5145,20 +5141,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);