OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |