Commit e4c847f7 authored by kylechar's avatar kylechar Committed by Commit Bot

Check promise texture isn't null first

ImageContextImpl can sometimes not have a SkPromiseImageTexture
associated with it and return null from promise_image_texture(). This
happens when there the texture is missing and it's an external image
that a fallback can't be created for. Check before trying to dereference
a nullptr.

Bug: 1148283, 1092080, 1148095
Change-Id: I45c0c5a233925b889778fe6e65f2b3fbfa077ecb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533589Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826940}
parent 1acc0b0b
...@@ -931,12 +931,14 @@ void SkiaOutputSurfaceImplOnGpu::BeginAccessImages( ...@@ -931,12 +931,14 @@ void SkiaOutputSurfaceImplOnGpu::BeginAccessImages(
// Texture parameters can be modified by concurrent reads so reset them // Texture parameters can be modified by concurrent reads so reset them
// before compositing from the texture. See https://crbug.com/1092080. // before compositing from the texture. See https://crbug.com/1092080.
if (is_gl) { if (is_gl) {
GrBackendTexture backend_texture = auto* promise_texture = context->promise_image_texture();
context->promise_image_texture()->backendTexture(); if (promise_texture) {
GrBackendTexture backend_texture = promise_texture->backendTexture();
backend_texture.glTextureParametersModified(); backend_texture.glTextureParametersModified();
} }
} }
} }
}
} }
void SkiaOutputSurfaceImplOnGpu::ResetStateOfImages() { void SkiaOutputSurfaceImplOnGpu::ResetStateOfImages() {
......
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