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

Unified Diff: cc/output/gl_renderer.cc

Issue 23572033: cc: Add test for AA quads due to precision loss (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: danakj review comments Created 7 years, 3 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/output/gl_renderer.h ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index a80feac4ecc9f97f3fd5e731d99a43cc7ea98a99..d2df0b31c310e6851aeb0295b7aac568992ed20f 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -1131,11 +1131,12 @@ static void SolidColorUniformLocation(T program,
uniforms->color_location = program->fragment_shader().color_location();
}
+// static
bool GLRenderer::SetupQuadForAntialiasing(
const gfx::Transform& device_transform,
const DrawQuad* quad,
gfx::QuadF* local_quad,
- float edge[24]) const {
+ float edge[24]) {
gfx::Rect tile_rect = quad->visible_rect;
bool clipped = false;
@@ -1146,11 +1147,8 @@ bool GLRenderer::SetupQuadForAntialiasing(
bool is_nearest_rect_within_epsilon = is_axis_aligned_in_target &&
gfx::IsNearestRectWithinDistance(device_layer_quad.BoundingBox(),
kAntiAliasingEpsilon);
-
- bool use_aa = Settings().allow_antialiasing &&
- !clipped && // code can't handle clipped quads
- !is_nearest_rect_within_epsilon &&
- quad->IsEdge();
+ // AAing clipped quads is not supported by the code yet.
+ bool use_aa = !clipped && !is_nearest_rect_within_epsilon && quad->IsEdge();
if (!use_aa)
return false;
@@ -1239,8 +1237,9 @@ void GLRenderer::DrawSolidColorQuad(const DrawingFrame* frame,
gfx::QuadF local_quad = gfx::QuadF(gfx::RectF(tile_rect));
float edge[24];
- bool use_aa = !quad->force_anti_aliasing_off && SetupQuadForAntialiasing(
- device_transform, quad, &local_quad, edge);
+ bool use_aa =
+ Settings().allow_antialiasing && !quad->force_anti_aliasing_off &&
+ SetupQuadForAntialiasing(device_transform, quad, &local_quad, edge);
SolidColorProgramUniforms uniforms;
if (use_aa)
@@ -1378,7 +1377,7 @@ void GLRenderer::DrawContentQuad(const DrawingFrame* frame,
gfx::QuadF local_quad = gfx::QuadF(gfx::RectF(tile_rect));
float edge[24];
- bool use_aa = SetupQuadForAntialiasing(
+ bool use_aa = Settings().allow_antialiasing && SetupQuadForAntialiasing(
device_transform, quad, &local_quad, edge);
TileProgramUniforms uniforms;
« no previous file with comments | « cc/output/gl_renderer.h ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698