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

Side by Side Diff: cc/gl_renderer.cc

Issue 12208140: Revert "cc: Clamp texture coordinates in all tile shaders" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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 | « cc/gl_renderer.h ('k') | cc/shader.h » ('j') | 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 "cc/gl_renderer.h" 5 #include "cc/gl_renderer.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 // Map device space quad to local space. deviceTransform has no 3d compo nent since it was flattened, so we don't need to project. 885 // Map device space quad to local space. deviceTransform has no 3d compo nent since it was flattened, so we don't need to project.
886 // We should have already checked that the transform was uninvertible ab ove. 886 // We should have already checked that the transform was uninvertible ab ove.
887 gfx::Transform inverseDeviceTransform(gfx::Transform::kSkipInitializatio n); 887 gfx::Transform inverseDeviceTransform(gfx::Transform::kSkipInitializatio n);
888 bool didInvert = deviceTransform.GetInverse(&inverseDeviceTransform); 888 bool didInvert = deviceTransform.GetInverse(&inverseDeviceTransform);
889 DCHECK(didInvert); 889 DCHECK(didInvert);
890 localQuad = MathUtil::mapQuad(inverseDeviceTransform, deviceQuad.ToQuadF (), clipped); 890 localQuad = MathUtil::mapQuad(inverseDeviceTransform, deviceQuad.ToQuadF (), clipped);
891 891
892 // We should not DCHECK(!clipped) here, because anti-aliasing inflation may cause deviceQuad to become 892 // We should not DCHECK(!clipped) here, because anti-aliasing inflation may cause deviceQuad to become
893 // clipped. To our knowledge this scenario does not need to be handled d ifferently than the unclipped case. 893 // clipped. To our knowledge this scenario does not need to be handled d ifferently than the unclipped case.
894 } else { 894 } else {
895 // Move fragment shader transform to vertex shader. We can do this while
896 // still producing correct results as fragmentTexTransformLocation
897 // should always be non-negative when tiles are transformed in a way
898 // that could result in sampling outside the layer.
899 vertexTexScaleX *= fragmentTexScaleX;
900 vertexTexScaleY *= fragmentTexScaleY;
901 vertexTexTranslateX *= fragmentTexScaleX;
902 vertexTexTranslateY *= fragmentTexScaleY;
903 vertexTexTranslateX += fragmentTexTranslateX;
904 vertexTexTranslateY += fragmentTexTranslateY;
905
895 GLC(context(), context()->uniform4f(uniforms.vertexTexTransformLocation, vertexTexTranslateX, vertexTexTranslateY, vertexTexScaleX, vertexTexScaleY)); 906 GLC(context(), context()->uniform4f(uniforms.vertexTexTransformLocation, vertexTexTranslateX, vertexTexTranslateY, vertexTexScaleX, vertexTexScaleY));
896 GLC(context(), context()->uniform4f(uniforms.fragmentTexTransformLocatio n, fragmentTexTranslateX, fragmentTexTranslateY, fragmentTexScaleX, fragmentTexS caleY));
897 907
898 localQuad = gfx::RectF(tileRect); 908 localQuad = gfx::RectF(tileRect);
899 } 909 }
900 910
901 // Normalize to tileRect. 911 // Normalize to tileRect.
902 localQuad.Scale(1.0f / tileRect.width(), 1.0f / tileRect.height()); 912 localQuad.Scale(1.0f / tileRect.width(), 1.0f / tileRect.height());
903 913
904 setShaderOpacity(quad->opacity(), uniforms.alphaLocation); 914 setShaderOpacity(quad->opacity(), uniforms.alphaLocation);
905 setShaderQuadF(localQuad, uniforms.pointLocation); 915 setShaderQuadF(localQuad, uniforms.pointLocation);
906 916
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 1823
1814 releaseRenderPassTextures(); 1824 releaseRenderPassTextures();
1815 } 1825 }
1816 1826
1817 bool GLRenderer::isContextLost() 1827 bool GLRenderer::isContextLost()
1818 { 1828 {
1819 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR); 1829 return (m_context->getGraphicsResetStatusARB() != GL_NO_ERROR);
1820 } 1830 }
1821 1831
1822 } // namespace cc 1832 } // namespace cc
OLDNEW
« no previous file with comments | « cc/gl_renderer.h ('k') | cc/shader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698