| 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 "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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 | 621 |
| 622 shaderMatrixLocation = program->vertexShader().matrixLocation(); | 622 shaderMatrixLocation = program->vertexShader().matrixLocation(); |
| 623 shaderAlphaLocation = program->fragmentShader().alphaLocation(); | 623 shaderAlphaLocation = program->fragmentShader().alphaLocation(); |
| 624 } | 624 } |
| 625 | 625 |
| 626 if (shaderMaskSamplerLocation != -1) { | 626 if (shaderMaskSamplerLocation != -1) { |
| 627 DCHECK(shaderMaskTexCoordScaleLocation != 1); | 627 DCHECK(shaderMaskTexCoordScaleLocation != 1); |
| 628 DCHECK(shaderMaskTexCoordOffsetLocation != 1); | 628 DCHECK(shaderMaskTexCoordOffsetLocation != 1); |
| 629 GLC(context(), context()->activeTexture(GL_TEXTURE1)); | 629 GLC(context(), context()->activeTexture(GL_TEXTURE1)); |
| 630 GLC(context(), context()->uniform1i(shaderMaskSamplerLocation, 1)); | 630 GLC(context(), context()->uniform1i(shaderMaskSamplerLocation, 1)); |
| 631 GLC(context(), context()->uniform2f(shaderMaskTexCoordScaleLocation, qua
d->mask_tex_coord_scale_x, quad->mask_tex_coord_scale_y)); | 631 GLC(context(), context()->uniform2f(shaderMaskTexCoordOffsetLocation, qu
ad->mask_uv_rect.x(), quad->mask_uv_rect.y())); |
| 632 GLC(context(), context()->uniform2f(shaderMaskTexCoordOffsetLocation, qu
ad->mask_tex_coord_offset_x, quad->mask_tex_coord_offset_y)); | 632 GLC(context(), context()->uniform2f(shaderMaskTexCoordScaleLocation, qua
d->mask_uv_rect.width(), quad->mask_uv_rect.height())); |
| 633 m_resourceProvider->bindForSampling(quad->mask_resource_id, GL_TEXTURE_2
D, GL_LINEAR); | 633 m_resourceProvider->bindForSampling(quad->mask_resource_id, GL_TEXTURE_2
D, GL_LINEAR); |
| 634 GLC(context(), context()->activeTexture(GL_TEXTURE0)); | 634 GLC(context(), context()->activeTexture(GL_TEXTURE0)); |
| 635 } | 635 } |
| 636 | 636 |
| 637 if (shaderEdgeLocation != -1) { | 637 if (shaderEdgeLocation != -1) { |
| 638 float edge[24]; | 638 float edge[24]; |
| 639 deviceLayerEdges.toFloatArray(edge); | 639 deviceLayerEdges.toFloatArray(edge); |
| 640 deviceLayerBounds.toFloatArray(&edge[12]); | 640 deviceLayerBounds.toFloatArray(&edge[12]); |
| 641 GLC(context(), context()->uniform3fv(shaderEdgeLocation, 8, edge)); | 641 GLC(context(), context()->uniform3fv(shaderEdgeLocation, 8, edge)); |
| 642 } | 642 } |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1746 | 1746 |
| 1747 releaseRenderPassTextures(); | 1747 releaseRenderPassTextures(); |
| 1748 } | 1748 } |
| 1749 | 1749 |
| 1750 bool GLRenderer::isContextLost() | 1750 bool GLRenderer::isContextLost() |
| 1751 { | 1751 { |
| 1752 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1752 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
| 1753 } | 1753 } |
| 1754 | 1754 |
| 1755 } // namespace cc | 1755 } // namespace cc |
| OLD | NEW |