Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2304)

Unified Diff: cc/output/gl_renderer.cc

Issue 14705008: cc: Cache highp_threshold in TexCoordPrecisionRequired (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Remove unnecessary statics. Allow min to vary. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/gl_renderer.h ('k') | cc/output/shader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 5577aa4e26b16857c3a466c5a977eb02a52671a1..c33fa47cca6d8a34ec0a72e099591eb6e3cd55a1 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -128,6 +128,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_);
}
@@ -771,7 +772,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;
@@ -1251,7 +1252,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;
@@ -1369,7 +1371,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);
@@ -1441,7 +1443,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 =
@@ -1615,7 +1617,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
@@ -1670,7 +1672,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;
@@ -1724,7 +1726,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;
@@ -1870,7 +1872,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));
« no previous file with comments | « cc/output/gl_renderer.h ('k') | cc/output/shader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698