Commit 729b9b17 authored by Robert Phillips's avatar Robert Phillips Committed by Commit Bot

Guard against MakePromiseSkImageFromRenderPass failure

SkDeferredDisplayListRecorder::makePromiseTexture can fail for a
variety reasons (in the repro case the requested width/height is
320/10048 while the max texture size is 8192) so try to fail
gracefully.

Bug: 1068253
Change-Id: I5fcb25343fe397240330e23db902c97cee71c239
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351955Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Cr-Commit-Position: refs/heads/master@{#797280}
parent a3fbd28f
...@@ -2519,6 +2519,10 @@ void SkiaRenderer::DrawRenderPassQuad(const RenderPassDrawQuad* quad, ...@@ -2519,6 +2519,10 @@ void SkiaRenderer::DrawRenderPassQuad(const RenderPassDrawQuad* quad,
} }
} }
if (!content_image) {
return;
}
// If the RP generated mipmaps when it was created, set quality to medium, // If the RP generated mipmaps when it was created, set quality to medium,
// which turns on mipmap filtering in Skia. // which turns on mipmap filtering in Skia.
if (backing.generate_mipmap) if (backing.generate_mipmap)
......
...@@ -598,7 +598,9 @@ sk_sp<SkImage> SkiaOutputSurfaceImpl::MakePromiseSkImageFromRenderPass( ...@@ -598,7 +598,9 @@ sk_sp<SkImage> SkiaOutputSurfaceImpl::MakePromiseSkImageFromRenderPass(
image_context->color_space(), Fulfill, DoNothing, DoNothing, image_context->color_space(), Fulfill, DoNothing, DoNothing,
image_context.get()), image_context.get()),
backend_format); backend_format);
DCHECK(image_context->has_image()); if (!image_context->has_image()) {
return nullptr;
}
} }
images_in_current_paint_.push_back(image_context.get()); images_in_current_paint_.push_back(image_context.get());
return image_context->image(); return image_context->image();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment