| 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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 ResourceProvider::ScopedReadLockGL vPlaneLock(m_resourceProvider, vPlane.res
ourceId); | 858 ResourceProvider::ScopedReadLockGL vPlaneLock(m_resourceProvider, vPlane.res
ourceId); |
| 859 GLC(context(), context()->activeTexture(GL_TEXTURE1)); | 859 GLC(context(), context()->activeTexture(GL_TEXTURE1)); |
| 860 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, yPlaneLock.textureId())
); | 860 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, yPlaneLock.textureId())
); |
| 861 GLC(context(), context()->activeTexture(GL_TEXTURE2)); | 861 GLC(context(), context()->activeTexture(GL_TEXTURE2)); |
| 862 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, uPlaneLock.textureId())
); | 862 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, uPlaneLock.textureId())
); |
| 863 GLC(context(), context()->activeTexture(GL_TEXTURE3)); | 863 GLC(context(), context()->activeTexture(GL_TEXTURE3)); |
| 864 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, vPlaneLock.textureId())
); | 864 GLC(context(), context()->bindTexture(GL_TEXTURE_2D, vPlaneLock.textureId())
); |
| 865 | 865 |
| 866 GLC(context(), context()->useProgram(program->program())); | 866 GLC(context(), context()->useProgram(program->program())); |
| 867 | 867 |
| 868 float yWidthScaleFactor = static_cast<float>(yPlane.visibleSize.width()) / y
Plane.size.width(); | 868 GLC(context(), context()->uniform2f(program->vertexShader().texScaleLocation
(), quad->texScale().width(), quad->texScale().height())); |
| 869 // Arbitrarily take the u sizes because u and v dimensions are identical. | |
| 870 float uvWidthScaleFactor = static_cast<float>(uPlane.visibleSize.width()) /
uPlane.size.width(); | |
| 871 GLC(context(), context()->uniform1f(program->vertexShader().yWidthScaleFacto
rLocation(), yWidthScaleFactor)); | |
| 872 GLC(context(), context()->uniform1f(program->vertexShader().uvWidthScaleFact
orLocation(), uvWidthScaleFactor)); | |
| 873 | |
| 874 GLC(context(), context()->uniform1i(program->fragmentShader().yTextureLocati
on(), 1)); | 869 GLC(context(), context()->uniform1i(program->fragmentShader().yTextureLocati
on(), 1)); |
| 875 GLC(context(), context()->uniform1i(program->fragmentShader().uTextureLocati
on(), 2)); | 870 GLC(context(), context()->uniform1i(program->fragmentShader().uTextureLocati
on(), 2)); |
| 876 GLC(context(), context()->uniform1i(program->fragmentShader().vTextureLocati
on(), 3)); | 871 GLC(context(), context()->uniform1i(program->fragmentShader().vTextureLocati
on(), 3)); |
| 877 | 872 |
| 878 // These values are magic numbers that are used in the transformation from Y
UV to RGB color values. | 873 // These values are magic numbers that are used in the transformation from Y
UV to RGB color values. |
| 879 // They are taken from the following webpage: http://www.fourcc.org/fccyvrgb
.php | 874 // They are taken from the following webpage: http://www.fourcc.org/fccyvrgb
.php |
| 880 float yuv2RGB[9] = { | 875 float yuv2RGB[9] = { |
| 881 1.164f, 1.164f, 1.164f, | 876 1.164f, 1.164f, 1.164f, |
| 882 0.f, -.391f, 2.018f, | 877 0.f, -.391f, 2.018f, |
| 883 1.596f, -.813f, 0.f, | 878 1.596f, -.813f, 0.f, |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 | 1588 |
| 1594 releaseRenderPassTextures(); | 1589 releaseRenderPassTextures(); |
| 1595 } | 1590 } |
| 1596 | 1591 |
| 1597 bool GLRenderer::isContextLost() | 1592 bool GLRenderer::isContextLost() |
| 1598 { | 1593 { |
| 1599 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1594 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 1600 } | 1595 } |
| 1601 | 1596 |
| 1602 } // namespace cc | 1597 } // namespace cc |
| OLD | NEW |