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

Unified Diff: cc/tiled_layer_impl.cc

Issue 11649005: cc: Support anti-aliasing for solid color layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: per edge anti-aliasing Created 8 years 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
« cc/solid_color_draw_quad.h ('K') | « cc/test/render_pass_test_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiled_layer_impl.cc
diff --git a/cc/tiled_layer_impl.cc b/cc/tiled_layer_impl.cc
index 67144052561e01d462aa43f71540f4090284ba5e..5e66c2cec9ed97527db7e16ed0e17b7a9b0610c3 100644
--- a/cc/tiled_layer_impl.cc
+++ b/cc/tiled_layer_impl.cc
@@ -164,6 +164,16 @@ void TiledLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad
if (tileRect.IsEmpty())
continue;
+ bool clipped = false;
+ gfx::QuadF visibleContentInTargetQuad = MathUtil::mapQuad(drawTransform(), gfx::QuadF(visibleContentRect()), clipped);
+ bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad.IsRectilinear();
+ bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget;
+
+ bool leftEdgeAA = !i && useAA;
+ bool topEdgeAA = !j && useAA;
+ bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA;
+ bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA;
+
if (!tile || !tile->resourceId()) {
if (drawCheckerboardForMissingTiles()) {
SkColor checkerColor;
@@ -178,7 +188,7 @@ void TiledLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad
appendQuadsData.numMissingTiles++;
} else {
scoped_ptr<SolidColorDrawQuad> solidColorQuad = SolidColorDrawQuad::Create();
- solidColorQuad->SetNew(sharedQuadState, tileRect, backgroundColor());
+ solidColorQuad->SetNew(sharedQuadState, tileRect, backgroundColor(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA);
if (quadSink.append(solidColorQuad.PassAs<DrawQuad>(), appendQuadsData))
appendQuadsData.numMissingTiles++;
}
@@ -197,16 +207,6 @@ void TiledLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad
float tileHeight = static_cast<float>(m_tiler->tileSize().height());
gfx::Size textureSize(tileWidth, tileHeight);
- bool clipped = false;
- gfx::QuadF visibleContentInTargetQuad = MathUtil::mapQuad(drawTransform(), gfx::QuadF(visibleContentRect()), clipped);
- bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad.IsRectilinear();
- bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget;
-
- bool leftEdgeAA = !i && useAA;
- bool topEdgeAA = !j && useAA;
- bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA;
- bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA;
-
scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create();
quad->SetNew(sharedQuadState, tileRect, tileOpaqueRect, tile->resourceId(), texCoordRect, textureSize, tile->contentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA);
quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
« cc/solid_color_draw_quad.h ('K') | « cc/test/render_pass_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698