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

Unified Diff: cc/gl_renderer.cc

Issue 11829047: cc: Move anti-aliasing decision to parent compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add crbug url Created 7 years, 11 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 | « no previous file | cc/picture_layer_impl.cc » ('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 83827a296b184abc2f360c137e00de636e88e5ae..60780803a3c5c27ce6d65671a69c28a155daadfe 100644
--- a/cc/gl_renderer.cc
+++ b/cc/gl_renderer.cc
@@ -778,10 +778,14 @@ void GLRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQuad* qua
gfx::QuadF deviceLayerQuad = MathUtil::mapQuad(deviceTransform, gfx::QuadF(quad->visibleContentRect()), clipped);
DCHECK(!clipped);
+ // TODO(reveman): Axis-aligned is not enough to avoid anti-aliasing.
+ // Bounding rectangle for quad also needs to be expressible as
+ // an integer rectangle. crbug.com/169374
+ bool isAxisAlignedInTarget = deviceLayerQuad.IsRectilinear();
+ bool useAA = !clipped && !isAxisAlignedInTarget && quad->IsAntialiased();
+
TileProgramUniforms uniforms;
- // For now, we simply skip anti-aliasing with the quad is clipped. This only happens
- // on perspective transformed layers that go partially behind the camera.
- if (quad->IsAntialiased() && !clipped) {
+ if (useAA) {
if (quad->swizzle_contents)
tileUniformLocation(tileProgramSwizzleAA(), uniforms);
else
@@ -806,7 +810,6 @@ void GLRenderer::drawTileQuad(const DrawingFrame& frame, const TileDrawQuad* qua
GLenum filter = (quad->IsAntialiased() || scaled || !quad->quadTransform().IsIdentityOrIntegerTranslation()) ? GL_LINEAR : GL_NEAREST;
ResourceProvider::ScopedSamplerGL quadResourceLock(m_resourceProvider, quad->resource_id, GL_TEXTURE_2D, filter);
- bool useAA = !clipped && quad->IsAntialiased();
if (useAA) {
LayerQuad deviceLayerBounds = LayerQuad(gfx::QuadF(deviceLayerQuad.BoundingBox()));
deviceLayerBounds.inflateAntiAliasingDistance();
« no previous file with comments | « no previous file | cc/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698