Chromium Code Reviews| 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 { |