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

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: Found the windows failure, and fixed it. Thanks akalin@ 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 | « cc/draw_quad_unittest.cc ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
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 "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 ResourceProvider::ScopedReadLockGL vPlaneLock(m_resourceProvider, vPlane.res ourceId); 860 ResourceProvider::ScopedReadLockGL vPlaneLock(m_resourceProvider, vPlane.res ourceId);
861 GLC(context(), context()->activeTexture(GL_TEXTURE1)); 861 GLC(context(), context()->activeTexture(GL_TEXTURE1));
862 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, yPlaneLock.textureId()) ); 862 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, yPlaneLock.textureId()) );
863 GLC(context(), context()->activeTexture(GL_TEXTURE2)); 863 GLC(context(), context()->activeTexture(GL_TEXTURE2));
864 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, uPlaneLock.textureId()) ); 864 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, uPlaneLock.textureId()) );
865 GLC(context(), context()->activeTexture(GL_TEXTURE3)); 865 GLC(context(), context()->activeTexture(GL_TEXTURE3));
866 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, vPlaneLock.textureId()) ); 866 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, vPlaneLock.textureId()) );
867 867
868 GLC(context(), context()->useProgram(program->program())); 868 GLC(context(), context()->useProgram(program->program()));
869 869
870 float yWidthScaleFactor = static_cast<float>(yPlane.visibleSize.width()) / y Plane.size.width(); 870 GLC(context(), context()->uniform2f(program->vertexShader().texScaleLocation (), quad->texScale().width(), quad->texScale().height()));
871 // Arbitrarily take the u sizes because u and v dimensions are identical.
872 float uvWidthScaleFactor = static_cast<float>(uPlane.visibleSize.width()) / uPlane.size.width();
873 GLC(context(), context()->uniform1f(program->vertexShader().yWidthScaleFacto rLocation(), yWidthScaleFactor));
874 GLC(context(), context()->uniform1f(program->vertexShader().uvWidthScaleFact orLocation(), uvWidthScaleFactor));
875
876 GLC(context(), context()->uniform1i(program->fragmentShader().yTextureLocati on(), 1)); 871 GLC(context(), context()->uniform1i(program->fragmentShader().yTextureLocati on(), 1));
877 GLC(context(), context()->uniform1i(program->fragmentShader().uTextureLocati on(), 2)); 872 GLC(context(), context()->uniform1i(program->fragmentShader().uTextureLocati on(), 2));
878 GLC(context(), context()->uniform1i(program->fragmentShader().vTextureLocati on(), 3)); 873 GLC(context(), context()->uniform1i(program->fragmentShader().vTextureLocati on(), 3));
879 874
880 // These values are magic numbers that are used in the transformation from Y UV to RGB color values. 875 // These values are magic numbers that are used in the transformation from Y UV to RGB color values.
881 // They are taken from the following webpage: http://www.fourcc.org/fccyvrgb .php 876 // They are taken from the following webpage: http://www.fourcc.org/fccyvrgb .php
882 float yuv2RGB[9] = { 877 float yuv2RGB[9] = {
883 1.164f, 1.164f, 1.164f, 878 1.164f, 1.164f, 1.164f,
884 0.f, -.391f, 2.018f, 879 0.f, -.391f, 2.018f,
885 1.596f, -.813f, 0.f, 880 1.596f, -.813f, 0.f,
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 1620
1626 releaseRenderPassTextures(); 1621 releaseRenderPassTextures();
1627 } 1622 }
1628 1623
1629 bool GLRenderer::isContextLost() 1624 bool GLRenderer::isContextLost()
1630 { 1625 {
1631 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); 1626 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR);
1632 } 1627 }
1633 1628
1634 } // namespace cc 1629 } // namespace cc
OLDNEW
« no previous file with comments | « cc/draw_quad_unittest.cc ('k') | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698