Chromium Code Reviews| 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 && |
|
epennerAtGoogle
2013/09/07 00:00:33
Nice short circuit.
|
| + 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; |