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

Unified Diff: cc/gl_renderer.cc

Issue 11442056: Add external surface rendering mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years 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/gl_renderer.cc
diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc
index a40dd3a245b80e384bea0d7cce273d2d441ff6ba..1c01675035e33bc7a7ac6b0d6d288b40c2697a7b 100644
--- a/cc/gl_renderer.cc
+++ b/cc/gl_renderer.cc
@@ -936,15 +936,22 @@ void GLRenderer::drawStreamVideoQuad(const DrawingFrame& frame, const StreamVide
const VideoStreamTextureProgram* program = videoStreamTextureProgram();
setUseProgram(program->program());
- toGLMatrix(&glMatrix[0], quad->matrix);
- GLC(context(), context()->uniformMatrix4fv(program->vertexShader().texMatrixLocation(), 1, false, glMatrix));
+ if (quad->texture_id == 0) {
+ // When texture_id == 0, punch a hole instead of rendering.
+ GLC(m_context, m_context->blendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA));
+ drawQuadGeometry(frame, quad->quadTransform(), quad->rect, program->vertexShader().matrixLocation());
+ GLC(m_context, m_context->blendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
+ } else {
danakj 2012/12/13 05:35:42 if you return at the end of the if() then you don'
wonsik2 2012/12/17 04:36:05 Done.
+ toGLMatrix(&glMatrix[0], quad->matrix);
+ GLC(context(), context()->uniformMatrix4fv(program->vertexShader().texMatrixLocation(), 1, false, glMatrix));
- GLC(context(), context()->bindTexture(GL_TEXTURE_EXTERNAL_OES, quad->texture_id));
+ GLC(context(), context()->bindTexture(GL_TEXTURE_EXTERNAL_OES, quad->texture_id));
- GLC(context(), context()->uniform1i(program->fragmentShader().samplerLocation(), 0));
+ GLC(context(), context()->uniform1i(program->fragmentShader().samplerLocation(), 0));
- setShaderOpacity(quad->opacity(), program->fragmentShader().alphaLocation());
- drawQuadGeometry(frame, quad->quadTransform(), quad->rect, program->vertexShader().matrixLocation());
+ setShaderOpacity(quad->opacity(), program->fragmentShader().alphaLocation());
+ drawQuadGeometry(frame, quad->quadTransform(), quad->rect, program->vertexShader().matrixLocation());
+ }
}
struct TextureProgramBinding {
« no previous file with comments | « no previous file | content/browser/android/content_video_view.h » ('j') | content/browser/android/media_player_manager_android.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698