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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/gl_renderer.h ('k') | cc/shader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/gl_renderer.cc
diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc
index 1b48615a12c70d9a905a4ed3b9166bb1fac04cf0..2db33992ad712b6035c20dbe307e533dcc4a2320 100644
--- a/cc/gl_renderer.cc
+++ b/cc/gl_renderer.cc
@@ -892,8 +892,18 @@ void GLRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQuad* qua
// We should not DCHECK(!clipped) here, because anti-aliasing inflation may cause deviceQuad to become
// clipped. To our knowledge this scenario does not need to be handled differently than the unclipped case.
} else {
+ // Move fragment shader transform to vertex shader. We can do this while
+ // still producing correct results as fragmentTexTransformLocation
+ // should always be non-negative when tiles are transformed in a way
+ // that could result in sampling outside the layer.
+ vertexTexScaleX *= fragmentTexScaleX;
+ vertexTexScaleY *= fragmentTexScaleY;
+ vertexTexTranslateX *= fragmentTexScaleX;
+ vertexTexTranslateY *= fragmentTexScaleY;
+ vertexTexTranslateX += fragmentTexTranslateX;
+ vertexTexTranslateY += fragmentTexTranslateY;
+
GLC(context(), context()->uniform4f(uniforms.vertexTexTransformLocation, vertexTexTranslateX, vertexTexTranslateY, vertexTexScaleX, vertexTexScaleY));
- GLC(context(), context()->uniform4f(uniforms.fragmentTexTransformLocation, fragmentTexTranslateX, fragmentTexTranslateY, fragmentTexScaleX, fragmentTexScaleY));
localQuad = gfx::RectF(tileRect);
}
« 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