Merge "Avoid sampling outside BQ crop rect" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5c86f2885f
@@ -183,8 +183,10 @@ CopyResult Readback::copySurfaceInto(ANativeWindow* window, const Rect& inSrcRec
|
|||||||
SkPaint paint;
|
SkPaint paint;
|
||||||
paint.setAlpha(255);
|
paint.setAlpha(255);
|
||||||
paint.setBlendMode(SkBlendMode::kSrc);
|
paint.setBlendMode(SkBlendMode::kSrc);
|
||||||
canvas->drawImageRect(image, imageSrcRect, imageDstRect, sampling, &paint,
|
const bool hasBufferCrop = cropRect.left < cropRect.right && cropRect.top < cropRect.bottom;
|
||||||
SkCanvas::kFast_SrcRectConstraint);
|
auto constraint =
|
||||||
|
hasBufferCrop ? SkCanvas::kStrict_SrcRectConstraint : SkCanvas::kFast_SrcRectConstraint;
|
||||||
|
canvas->drawImageRect(image, imageSrcRect, imageDstRect, sampling, &paint, constraint);
|
||||||
canvas->restore();
|
canvas->restore();
|
||||||
|
|
||||||
if (!tmpSurface->readPixels(*bitmap, 0, 0)) {
|
if (!tmpSurface->readPixels(*bitmap, 0, 0)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user