Index: cc/output/gl_renderer.cc |
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc |
index adfcf473665d0b7e0e317910b8d247a6258906f5..cac9d9ca70b8fde77bf2990a4c801bd6b0ea21c5 100644 |
--- a/cc/output/gl_renderer.cc |
+++ b/cc/output/gl_renderer.cc |
@@ -115,6 +115,7 @@ GLRenderer::GLRenderer(RendererClient* client, |
visible_(true), |
is_scissor_enabled_(false), |
highp_threshold_min_(highp_threshold_min), |
+ highp_threshold_cache_(0), |
on_demand_tile_raster_resource_id_(0) { |
DCHECK(context_); |
} |
@@ -751,7 +752,7 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame, |
} |
TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( |
- context_, highp_threshold_min_, |
+ context_, &highp_threshold_cache_, highp_threshold_min_, |
quad->shared_quad_state->visible_content_rect.bottom_right()); |
int shader_quad_location = -1; |
@@ -1226,7 +1227,8 @@ void GLRenderer::DrawContentQuad(const DrawingFrame* frame, |
float vertex_tex_scale_y = tile_rect.height() / clamp_geom_rect.height(); |
TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( |
- context_, highp_threshold_min_, quad->texture_size); |
+ context_, &highp_threshold_cache_, highp_threshold_min_, |
+ quad->texture_size); |
// Map to normalized texture coordinates. |
gfx::Size texture_size = quad->texture_size; |
@@ -1344,7 +1346,7 @@ void GLRenderer::DrawYUVVideoQuad(const DrawingFrame* frame, |
SetBlendEnabled(quad->ShouldDrawWithBlending()); |
TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( |
- context_, highp_threshold_min_, |
+ context_, &highp_threshold_cache_, highp_threshold_min_, |
quad->shared_quad_state->visible_content_rect.bottom_right()); |
const VideoYUVProgram* program = GetVideoYUVProgram(tex_coord_precision); |
@@ -1416,7 +1418,7 @@ void GLRenderer::DrawStreamVideoQuad(const DrawingFrame* frame, |
DCHECK(capabilities_.using_egl_image); |
TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( |
- context_, highp_threshold_min_, |
+ context_, &highp_threshold_cache_, highp_threshold_min_, |
quad->shared_quad_state->visible_content_rect.bottom_right()); |
const VideoStreamTextureProgram* program = |
@@ -1590,7 +1592,7 @@ void GLRenderer::FlushTextureQuadCache() { |
void GLRenderer::EnqueueTextureQuad(const DrawingFrame* frame, |
const TextureDrawQuad* quad) { |
TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( |
- context_, highp_threshold_min_, |
+ context_, &highp_threshold_cache_, highp_threshold_min_, |
quad->shared_quad_state->visible_content_rect.bottom_right()); |
// Choose the correct texture program binding |
@@ -1645,7 +1647,7 @@ void GLRenderer::EnqueueTextureQuad(const DrawingFrame* frame, |
void GLRenderer::DrawTextureQuad(const DrawingFrame* frame, |
const TextureDrawQuad* quad) { |
TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( |
- context_, highp_threshold_min_, |
+ context_, &highp_threshold_cache_, highp_threshold_min_, |
quad->shared_quad_state->visible_content_rect.bottom_right()); |
TexTransformTextureProgramBinding binding; |
@@ -1699,7 +1701,7 @@ void GLRenderer::DrawIOSurfaceQuad(const DrawingFrame* frame, |
SetBlendEnabled(quad->ShouldDrawWithBlending()); |
TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( |
- context_, highp_threshold_min_, |
+ context_, &highp_threshold_cache_, highp_threshold_min_, |
quad->shared_quad_state->visible_content_rect.bottom_right()); |
TexTransformTextureProgramBinding binding; |
@@ -1852,7 +1854,8 @@ void GLRenderer::CopyTextureToFramebuffer(const DrawingFrame* frame, |
gfx::Rect rect, |
const gfx::Transform& draw_matrix) { |
TexCoordPrecision tex_coord_precision = TexCoordPrecisionRequired( |
- context_, highp_threshold_min_, rect.bottom_right()); |
+ context_, &highp_threshold_cache_, highp_threshold_min_, |
+ rect.bottom_right()); |
const RenderPassProgram* program = GetRenderPassProgram(tex_coord_precision); |
GLC(Context(), Context()->bindTexture(GL_TEXTURE_2D, texture_id)); |