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

Side by Side 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: Add getPersonality() 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 unified diff | Download patch
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/gl_renderer.h" 5 #include "cc/gl_renderer.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 929
930 void GLRenderer::drawStreamVideoQuad(const DrawingFrame& frame, const StreamVide oDrawQuad* quad) 930 void GLRenderer::drawStreamVideoQuad(const DrawingFrame& frame, const StreamVide oDrawQuad* quad)
931 { 931 {
932 static float glMatrix[16]; 932 static float glMatrix[16];
933 933
934 DCHECK(m_capabilities.usingEglImage); 934 DCHECK(m_capabilities.usingEglImage);
935 935
936 const VideoStreamTextureProgram* program = videoStreamTextureProgram(); 936 const VideoStreamTextureProgram* program = videoStreamTextureProgram();
937 setUseProgram(program->program()); 937 setUseProgram(program->program());
938 938
939 if (quad->texture_id == 0) {
940 // When texture_id == 0, punch a hole instead of rendering.
qinmin 2012/12/17 19:34:06 nit: fix indent
enne (OOO) 2012/12/17 20:38:28 What do you mean by punch a hole? Maybe I'm misund
wonsik2 2013/02/14 14:56:38 It seems that 4 spaces are used throughout the fil
wonsik2 2013/02/14 14:56:38 Skipping a quad will make the background occlude t
941 GLC(m_context, m_context->blendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA));
942 drawQuadGeometry(frame, quad->quadTransform(), quad->rect, program->vert exShader().matrixLocation());
943 GLC(m_context, m_context->blendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA));
944 return;
945 }
939 toGLMatrix(&glMatrix[0], quad->matrix); 946 toGLMatrix(&glMatrix[0], quad->matrix);
940 GLC(context(), context()->uniformMatrix4fv(program->vertexShader().texMatrix Location(), 1, false, glMatrix)); 947 GLC(context(), context()->uniformMatrix4fv(program->vertexShader().texMatrix Location(), 1, false, glMatrix));
941 948
942 GLC(context(), context()->bindTexture(GL_TEXTURE_EXTERNAL_OES, quad->texture _id)); 949 GLC(context(), context()->bindTexture(GL_TEXTURE_EXTERNAL_OES, quad->texture _id));
943 950
944 GLC(context(), context()->uniform1i(program->fragmentShader().samplerLocatio n(), 0)); 951 GLC(context(), context()->uniform1i(program->fragmentShader().samplerLocatio n(), 0));
945 952
946 setShaderOpacity(quad->opacity(), program->fragmentShader().alphaLocation()) ; 953 setShaderOpacity(quad->opacity(), program->fragmentShader().alphaLocation()) ;
947 drawQuadGeometry(frame, quad->quadTransform(), quad->rect, program->vertexSh ader().matrixLocation()); 954 drawQuadGeometry(frame, quad->quadTransform(), quad->rect, program->vertexSh ader().matrixLocation());
948 } 955 }
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 1753
1747 releaseRenderPassTextures(); 1754 releaseRenderPassTextures();
1748 } 1755 }
1749 1756
1750 bool GLRenderer::isContextLost() 1757 bool GLRenderer::isContextLost()
1751 { 1758 {
1752 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); 1759 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR);
1753 } 1760 }
1754 1761
1755 } // namespace cc 1762 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/browser/android/content_video_view.h » ('j') | content/browser/android/content_video_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698