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

Unified Diff: cc/gl_renderer.cc

Issue 12255032: Implement "hole" video frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/gl_renderer.cc
diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc
index 42aaf8f6d9ea87a181eb4d04b174a69126aebfbf..cf9f4f39fdfc3fc84cf33dc4df0ed29bb12004a7 100644
--- a/cc/gl_renderer.cc
+++ b/cc/gl_renderer.cc
@@ -989,6 +989,16 @@ void GLRenderer::drawStreamVideoQuad(const DrawingFrame& frame, const StreamVide
const VideoStreamTextureProgram* program = videoStreamTextureProgram();
setUseProgram(program->program());
+ if (quad->texture_id == 0) {
Vangelis Kokkevis 2013/02/21 18:52:54 I'm not too fond of the idea of using texture_id =
danakj 2013/02/21 19:01:51 That sounds like a solid color quad with needs ble
wonsik2 2013/02/26 04:52:24 Created a new quad type; PTAL
wonsik2 2013/02/26 04:52:24 I tried SolidColorDrawQuad with needs_blending ==
wonsik2 2013/02/26 06:47:03 With further investigation, it turned out that an
+ // When texture_id == 0, punch a hole instead of rendering. The video
+ // will be composited outside of Chrome rendering pipeline, and where
+ // video should be composited should remain transparent in this case.
+ 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));
+ return;
+ }
+
toGLMatrix(&glMatrix[0], quad->matrix);
GLC(context(), context()->uniformMatrix4fv(program->vertexShader().texMatrixLocation(), 1, false, glMatrix));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698