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

Side by Side Diff: cc/gl_renderer.cc

Issue 11365172: If a layer contains a filter, flush the compositor context before the filter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698