Commit ceb3da6c authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

viz: Fix params->background_texture == 0 case

In crrev.com/c/1296679 we removed unnecessary code given the assumption that
backdrop_texture could never be 0.

Unfortunately we missed the case where background_rect is empty, and we still
can have params->background_texture equal to 0.

This patch brings back that check.

Bug: 908293, 904981
Change-Id: I94a1109c839337b77589c69fa607d7dc074c0daf
Reviewed-on: https://chromium-review.googlesource.com/c/1351711Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611417}
parent 123a1041
......@@ -1062,8 +1062,6 @@ void GLRenderer::UpdateRPDQShadersForBlending(
DCHECK(params->background_image_id || IsContextLost());
}
}
}
if (params->background_image_id) {
// Reset original background texture if there is not any mask.
if (!quad->mask_resource_id()) {
......@@ -1072,11 +1070,16 @@ void GLRenderer::UpdateRPDQShadersForBlending(
}
} else if (CanApplyBlendModeUsingBlendFunc(blend_mode) &&
ShouldApplyBackgroundFilters(quad, params->backdrop_filters)) {
// Something went wrong with applying background filters to the backdrop.
// Something went wrong with applying background filters to the
// backdrop.
params->use_shaders_for_blending = false;
gl_->DeleteTextures(1, &params->background_texture);
params->background_texture = 0;
}
} else { // params->background_rect.IsEmpty()
DCHECK(!params->background_image_id);
params->use_shaders_for_blending = false;
}
}
// Need original background texture for mask?
......
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