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

Side by Side Diff: cc/gl_renderer.cc

Issue 11269017: Plumb through cropped output size for VideoFrame (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: Update. Created 8 years, 1 month 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
« no previous file with comments | « no previous file | cc/layer_tree_host_impl_unittest.cc » ('j') | cc/layer_tree_host_impl_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 6
7 #include "cc/gl_renderer.h" 7 #include "cc/gl_renderer.h"
8 8
9 #include "FloatQuad.h" 9 #include "FloatQuad.h"
10 #include "NotImplemented.h" 10 #include "NotImplemented.h"
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 ResourceProvider::ScopedReadLockGL vPlaneLock(m_resourceProvider, vPlane.res ourceId); 853 ResourceProvider::ScopedReadLockGL vPlaneLock(m_resourceProvider, vPlane.res ourceId);
854 GLC(context(), context()->activeTexture(GL_TEXTURE1)); 854 GLC(context(), context()->activeTexture(GL_TEXTURE1));
855 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, yPlaneLock.textureId()) ); 855 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, yPlaneLock.textureId()) );
856 GLC(context(), context()->activeTexture(GL_TEXTURE2)); 856 GLC(context(), context()->activeTexture(GL_TEXTURE2));
857 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, uPlaneLock.textureId()) ); 857 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, uPlaneLock.textureId()) );
858 GLC(context(), context()->activeTexture(GL_TEXTURE3)); 858 GLC(context(), context()->activeTexture(GL_TEXTURE3));
859 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, vPlaneLock.textureId()) ); 859 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, vPlaneLock.textureId()) );
860 860
861 GLC(context(), context()->useProgram(program->program())); 861 GLC(context(), context()->useProgram(program->program()));
862 862
863 float yWidthScaleFactor = static_cast<float>(yPlane.visibleSize.width()) / y Plane.size.width(); 863 GLC(context(), context()->uniform2f(program->vertexShader().texScaleLocation (), quad->texScale().width(), quad->texScale().height()));
864 // Arbitrarily take the u sizes because u and v dimensions are identical.
865 float uvWidthScaleFactor = static_cast<float>(uPlane.visibleSize.width()) / uPlane.size.width();
866 GLC(context(), context()->uniform1f(program->vertexShader().yWidthScaleFacto rLocation(), yWidthScaleFactor));
867 GLC(context(), context()->uniform1f(program->vertexShader().uvWidthScaleFact orLocation(), uvWidthScaleFactor));
868
869 GLC(context(), context()->uniform1i(program->fragmentShader().yTextureLocati on(), 1)); 864 GLC(context(), context()->uniform1i(program->fragmentShader().yTextureLocati on(), 1));
870 GLC(context(), context()->uniform1i(program->fragmentShader().uTextureLocati on(), 2)); 865 GLC(context(), context()->uniform1i(program->fragmentShader().uTextureLocati on(), 2));
871 GLC(context(), context()->uniform1i(program->fragmentShader().vTextureLocati on(), 3)); 866 GLC(context(), context()->uniform1i(program->fragmentShader().vTextureLocati on(), 3));
872 867
873 // These values are magic numbers that are used in the transformation from Y UV to RGB color values. 868 // These values are magic numbers that are used in the transformation from Y UV to RGB color values.
874 // They are taken from the following webpage: http://www.fourcc.org/fccyvrgb .php 869 // They are taken from the following webpage: http://www.fourcc.org/fccyvrgb .php
875 float yuv2RGB[9] = { 870 float yuv2RGB[9] = {
876 1.164f, 1.164f, 1.164f, 871 1.164f, 1.164f, 1.164f,
877 0.f, -.391f, 2.018f, 872 0.f, -.391f, 2.018f,
878 1.596f, -.813f, 0.f, 873 1.596f, -.813f, 0.f,
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 1583
1589 releaseRenderPassTextures(); 1584 releaseRenderPassTextures();
1590 } 1585 }
1591 1586
1592 bool GLRenderer::isContextLost() 1587 bool GLRenderer::isContextLost()
1593 { 1588 {
1594 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); 1589 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR);
1595 } 1590 }
1596 1591
1597 } // namespace cc 1592 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host_impl_unittest.cc » ('j') | cc/layer_tree_host_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698