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 "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 GLC(context(), context()->uniform3fv(shaderEdgeLocation, 8, edge)); | 641 GLC(context(), context()->uniform3fv(shaderEdgeLocation, 8, edge)); |
642 } | 642 } |
643 | 643 |
644 // Map device space quad to surface space. contentsDeviceTransform has no 3d
component since it was generated with to2dTransform() so we don't need to proje
ct. | 644 // Map device space quad to surface space. contentsDeviceTransform has no 3d
component since it was generated with to2dTransform() so we don't need to proje
ct. |
645 gfx::QuadF surfaceQuad = MathUtil::mapQuad(contentsDeviceTransformInverse, d
eviceLayerEdges.ToQuadF(), clipped); | 645 gfx::QuadF surfaceQuad = MathUtil::mapQuad(contentsDeviceTransformInverse, d
eviceLayerEdges.ToQuadF(), clipped); |
646 DCHECK(!clipped); | 646 DCHECK(!clipped); |
647 | 647 |
648 setShaderOpacity(quad->opacity(), shaderAlphaLocation); | 648 setShaderOpacity(quad->opacity(), shaderAlphaLocation); |
649 setShaderQuadF(surfaceQuad, shaderQuadLocation); | 649 setShaderQuadF(surfaceQuad, shaderQuadLocation); |
650 drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), shaderMatri
xLocation); | 650 drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), shaderMatri
xLocation); |
| 651 |
| 652 // Flush the compositor context before the filter bitmap goes out of |
| 653 // scope, so the draw gets processed before the filter texture gets deleted. |
| 654 if (filterBitmap.getTexture()) |
| 655 m_context->flush(); |
651 } | 656 } |
652 | 657 |
653 void GLRenderer::drawSolidColorQuad(const DrawingFrame& frame, const SolidColorD
rawQuad* quad) | 658 void GLRenderer::drawSolidColorQuad(const DrawingFrame& frame, const SolidColorD
rawQuad* quad) |
654 { | 659 { |
655 const SolidColorProgram* program = solidColorProgram(); | 660 const SolidColorProgram* program = solidColorProgram(); |
656 GLC(context(), context()->useProgram(program->program())); | 661 GLC(context(), context()->useProgram(program->program())); |
657 | 662 |
658 SkColor color = quad->color(); | 663 SkColor color = quad->color(); |
659 float opacity = quad->opacity(); | 664 float opacity = quad->opacity(); |
660 float alpha = (SkColorGetA(color) / 255.0) * opacity; | 665 float alpha = (SkColorGetA(color) / 255.0) * opacity; |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 | 1614 |
1610 releaseRenderPassTextures(); | 1615 releaseRenderPassTextures(); |
1611 } | 1616 } |
1612 | 1617 |
1613 bool GLRenderer::isContextLost() | 1618 bool GLRenderer::isContextLost() |
1614 { | 1619 { |
1615 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); | 1620 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); |
1616 } | 1621 } |
1617 | 1622 |
1618 } // namespace cc | 1623 } // namespace cc |
OLD | NEW |