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

Unified Diff: cc/output/gl_renderer.cc

Issue 1559203003: Add GLStreamTextureImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed shared context check and removed matrix from copier. Created 4 years, 10 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
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 2b20d25d39f18f17a362c4b0d88c4efa9d506731..e10be559256374dab28f8aae4787fa2c1bd23cd0 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2192,14 +2192,22 @@ void GLRenderer::DrawStreamVideoQuad(const DrawingFrame* frame,
SetUseProgram(program->program());
ToGLMatrix(&gl_matrix[0], quad->matrix);
- gl_->UniformMatrix4fv(program->vertex_shader().tex_matrix_location(), 1,
- false, gl_matrix);
ResourceProvider::ScopedReadLockGL lock(resource_provider_,
quad->resource_id());
+
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
+ // TODO(liberato): stream_texture_android should stop sending |gl_matrix| to
+ // the video frame provider with this change (and to us), but it should
+ // start reporting the current matrix via GLImage::GetCustomMatrix. Until
reveman 2016/02/19 19:15:39 nit: s/GLImage::GetCustomMatrix/GLStreamTextureIma
liberato (no reviews please) 2016/02/19 19:48:11 Done.
+ // then, though, this will use the matrix that we provide to it, unless the
+ // GLImage overrides it. This lets it also work with AVDACodecImage, which
+ // provides the correct custom matrix and supplies a default one to us.
+ gl_->UniformMatrix4fvStreamTextureMatrixCHROMIUM(
+ program->vertex_shader().tex_matrix_location(), false, gl_matrix);
+
gl_->Uniform1i(program->fragment_shader().sampler_location(), 0);
SetShaderOpacity(quad->shared_quad_state->opacity,

Powered by Google App Engine
This is Rietveld 408576698