Commit 906b53e5 authored by kylechar's avatar kylechar Committed by Commit Bot

Skip fallback images for external textures

If SkiaRenderer is missing a texture during draw it tries to allocate an
equivalent fallback texture of the correct size and attributes. This
doesn't work for externally allocated textures.

Currently ImageContextImpl::CreateFallbackImage() creates a
GrBackendTexture of type k2D instead of kExternal. This triggers a later
SkASSERT in GrTextureProxy::onValidateSurface(). When SkAsSSERTs are
disabled it still doesn't draw anything. Just skip drawing the fallback
texture by proving a null SkPromiseImageTexture instead.

Bug: 1029522
Change-Id: I6f370694116e8a47e8885492f1365783c046db65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946627Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720604}
parent f39940a5
......@@ -58,6 +58,12 @@ ImageContextImpl::~ImageContextImpl() {
void ImageContextImpl::CreateFallbackImage(
gpu::SharedContextState* context_state) {
// We can't allocate a fallback texture as the original texture was externally
// allocated. Skia will skip drawing a null SkPromiseImageTexture, do nothing
// and leave it null.
if (backend_format().textureType() == GrTextureType::kExternal)
return;
DCHECK(!fallback_context_state_);
fallback_context_state_ = context_state;
......
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