Commit 82036716 authored by Greg Daniel's avatar Greg Daniel Committed by Commit Bot

Fix up DCHECKS for ids returned from GetGLTextureIDFromSkImage in viz gl_renderer.

Bug: 834167
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: Ib3477a3d53ec89736cb334abb2349a728d980968
Reviewed-on: https://chromium-review.googlesource.com/1059732Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Greg Daniel <egdaniel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558872}
parent 71426b9a
......@@ -1029,7 +1029,9 @@ bool GLRenderer::InitializeRPDQParameters(
static GLuint GetGLTextureIDFromSkImage(const SkImage* image,
GrSurfaceOrigin* origin = nullptr) {
GrBackendTexture backend_texture = image->getBackendTexture(true, origin);
DCHECK(backend_texture.isValid());
if (!backend_texture.isValid()) {
return 0;
}
GrGLTextureInfo info;
bool result = backend_texture.getGLTextureInfo(&info);
DCHECK(result);
......@@ -1076,7 +1078,7 @@ void GLRenderer::UpdateRPDQShadersForBlending(
if (params->background_image) {
params->background_image_id =
GetGLTextureIDFromSkImage(params->background_image.get());
DCHECK(params->background_image_id);
DCHECK(params->background_image_id || IsContextLost());
}
}
}
......@@ -1217,7 +1219,7 @@ void GLRenderer::UpdateRPDQTexturesForSampling(
GrSurfaceOrigin origin;
GLuint filter_image_id =
GetGLTextureIDFromSkImage(params->filter_image.get(), &origin);
DCHECK(filter_image_id);
DCHECK(filter_image_id || IsContextLost());
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_2D, filter_image_id);
gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
......
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