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

Unified Diff: cc/output/gl_renderer.cc

Issue 207233002: cc: Support texcoord offsets in YUVVideoDrawQuad (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: c7cdf916 Rebase. Created 6 years, 9 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/renderer_pixeltest.cc » ('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 89b1e00554a01a3e2eed1ac300305bae578e7be0..79d9d0e990a188d2b59258e54d43fac3a7734a53 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -1631,8 +1631,9 @@ void GLRenderer::DrawYUVVideoQuad(const DrawingFrame* frame,
DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), a_plane_lock->target());
}
- int tex_scale_location = -1;
int matrix_location = -1;
+ int tex_scale_location = -1;
+ int tex_offset_location = -1;
int y_texture_location = -1;
int u_texture_location = -1;
int v_texture_location = -1;
@@ -1644,8 +1645,9 @@ void GLRenderer::DrawYUVVideoQuad(const DrawingFrame* frame,
const VideoYUVAProgram* program = GetVideoYUVAProgram(tex_coord_precision);
DCHECK(program && (program->initialized() || IsContextLost()));
SetUseProgram(program->program());
- tex_scale_location = program->vertex_shader().tex_scale_location();
matrix_location = program->vertex_shader().matrix_location();
+ tex_scale_location = program->vertex_shader().tex_scale_location();
+ tex_offset_location = program->vertex_shader().tex_offset_location();
y_texture_location = program->fragment_shader().y_texture_location();
u_texture_location = program->fragment_shader().u_texture_location();
v_texture_location = program->fragment_shader().v_texture_location();
@@ -1657,8 +1659,9 @@ void GLRenderer::DrawYUVVideoQuad(const DrawingFrame* frame,
const VideoYUVProgram* program = GetVideoYUVProgram(tex_coord_precision);
DCHECK(program && (program->initialized() || IsContextLost()));
SetUseProgram(program->program());
- tex_scale_location = program->vertex_shader().tex_scale_location();
matrix_location = program->vertex_shader().matrix_location();
+ tex_scale_location = program->vertex_shader().tex_scale_location();
+ tex_offset_location = program->vertex_shader().tex_offset_location();
y_texture_location = program->fragment_shader().y_texture_location();
u_texture_location = program->fragment_shader().u_texture_location();
v_texture_location = program->fragment_shader().v_texture_location();
@@ -1669,8 +1672,12 @@ void GLRenderer::DrawYUVVideoQuad(const DrawingFrame* frame,
GLC(gl_,
gl_->Uniform2f(tex_scale_location,
- quad->tex_scale.width(),
- quad->tex_scale.height()));
+ quad->tex_coord_rect.width(),
+ quad->tex_coord_rect.height()));
+ GLC(gl_,
+ gl_->Uniform2f(tex_offset_location,
+ quad->tex_coord_rect.x(),
+ quad->tex_coord_rect.y()));
GLC(gl_, gl_->Uniform1i(y_texture_location, 1));
GLC(gl_, gl_->Uniform1i(u_texture_location, 2));
GLC(gl_, gl_->Uniform1i(v_texture_location, 3));
« no previous file with comments | « cc/output/gl_renderer.h ('k') | cc/output/renderer_pixeltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698