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

Commit 4fd405df authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Avoid sampling outside BQ crop rect"

parents 483a604f f1344703
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -189,8 +189,10 @@ CopyResult Readback::copySurfaceInto(ANativeWindow* window, const Rect& inSrcRec
    if (srcRect.width() != bitmap->width() || srcRect.height() != bitmap->height()) {
        paint.setFilterQuality(kLow_SkFilterQuality);
    }
    canvas->drawImageRect(image, imageSrcRect, imageDstRect, &paint,
                          SkCanvas::kFast_SrcRectConstraint);
    const bool hasBufferCrop = cropRect.left < cropRect.right && cropRect.top < cropRect.bottom;
    auto constraint =
            hasBufferCrop ? SkCanvas::kStrict_SrcRectConstraint : SkCanvas::kFast_SrcRectConstraint;
    canvas->drawImageRect(image, imageSrcRect, imageDstRect, &paint, constraint);
    canvas->restore();

    if (!tmpSurface->readPixels(*bitmap, 0, 0)) {