From 84cb5d3fd906ddda7a04ec1bad6638ab36457af3 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 6 Feb 2020 16:11:31 -0500 Subject: [PATCH] Return after callback on failure in GrRenderTargetContext::asyncReadPixels Bug: chromium:1048251 Change-Id: I9c18e55fd791adbf446aa776de297b857af22b64 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269237 Commit-Queue: Brian Osman Auto-Submit: Brian Salomon Reviewed-by: Brian Osman (cherry picked from commit 4bb502630178e620c4e5a493f456aaa825b0f98c) Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270178 Reviewed-by: Brian Salomon Commit-Queue: Brian Salomon --- src/gpu/GrRenderTargetContext.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp index 6ee47ed631c7..d783915823e8 100644 --- a/src/gpu/GrRenderTargetContext.cpp +++ b/src/gpu/GrRenderTargetContext.cpp @@ -1875,6 +1875,7 @@ void GrRenderTargetContext::asyncReadPixels(const SkIRect& rect, SkColorType col if (!this->readPixels(ii, pm.writable_addr(), pm.rowBytes(), {rect.fLeft, rect.fTop})) { callback(context, nullptr); + return; } callback(context, std::move(result)); return;