From 7205ba44ed7b6208015d891417409c0a5eaf20ee Mon Sep 17 00:00:00 2001 From: "epenner@chromium.org" Date: Mon, 22 Jul 2013 22:53:55 +0000 Subject: CC: Add command-line flag to disable AA. This has helped a lot in finding the recent issues with AA. It's also always disabled on the Android browser compositor since we do our own feathered edges there. BUG=233101,256474,259154 Review URL: https://chromiumcodereview.appspot.com/19236005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212990 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/base/switches.cc | 4 ++++ cc/base/switches.h | 1 + cc/output/gl_renderer.cc | 6 ++++-- cc/output/software_renderer.cc | 3 ++- cc/trees/layer_tree_settings.cc | 1 + cc/trees/layer_tree_settings.h | 1 + 6 files changed, 13 insertions(+), 3 deletions(-) (limited to 'cc') diff --git a/cc/base/switches.cc b/cc/base/switches.cc index 768cfde..2dac58b 100644 --- a/cc/base/switches.cc +++ b/cc/base/switches.cc @@ -16,6 +16,10 @@ const char kBackgroundColorInsteadOfCheckerboard[] = const char kDisableThreadedAnimation[] = "disable-threaded-animation"; +// Disables layer-edge anti-aliasing in the compositor. +const char kDisableCompositedAntialiasing[] = + "disable-composited-antialiasing"; + // Paint content on the main thread instead of the compositor thread. // Overrides the kEnableImplSidePainting flag. const char kDisableImplSidePainting[] = "disable-impl-side-painting"; diff --git a/cc/base/switches.h b/cc/base/switches.h index 00acca8..f87eb53 100644 --- a/cc/base/switches.h +++ b/cc/base/switches.h @@ -19,6 +19,7 @@ namespace switches { CC_EXPORT extern const char kBackgroundColorInsteadOfCheckerboard[]; CC_EXPORT extern const char kDisableImplSidePainting[]; CC_EXPORT extern const char kDisableThreadedAnimation[]; +CC_EXPORT extern const char kDisableCompositedAntialiasing[]; CC_EXPORT extern const char kEnableImplSidePainting[]; CC_EXPORT extern const char kEnableTopControlsPositionCalculation[]; CC_EXPORT extern const char kForceDirectLayerDrawing[]; diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 0133b27..c801553 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -1124,8 +1124,10 @@ bool GLRenderer::SetupQuadForAntialiasing( bool is_nearest_rect_within_epsilon = is_axis_aligned_in_target && gfx::IsNearestRectWithinDistance(device_layer_quad.BoundingBox(), kAntiAliasingEpsilon); - bool use_aa = !clipped && !is_nearest_rect_within_epsilon && quad->IsEdge(); - + bool use_aa = Settings().allow_antialiasing && + !clipped && + !is_nearest_rect_within_epsilon && + quad->IsEdge(); if (!use_aa) return false; diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc index c164d52..7eac62f 100644 --- a/cc/output/software_renderer.cc +++ b/cc/output/software_renderer.cc @@ -226,7 +226,8 @@ void SoftwareRenderer::DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) { quad->IsLeftEdge() && quad->IsBottomEdge() && quad->IsRightEdge(); - if (all_four_edges_are_exterior) + if (Settings().allow_antialiasing && + all_four_edges_are_exterior) current_paint_.setAntiAlias(true); current_paint_.setFilterBitmap(true); } diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc index 8d60efe..b041d8b 100644 --- a/cc/trees/layer_tree_settings.cc +++ b/cc/trees/layer_tree_settings.cc @@ -14,6 +14,7 @@ namespace cc { LayerTreeSettings::LayerTreeSettings() : impl_side_painting(false), + allow_antialiasing(true), throttle_frame_production(true), begin_frame_scheduling_enabled(false), using_synchronous_renderer_compositor(false), diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h index 69c5eeb..9de5ce9 100644 --- a/cc/trees/layer_tree_settings.h +++ b/cc/trees/layer_tree_settings.h @@ -21,6 +21,7 @@ class CC_EXPORT LayerTreeSettings { ~LayerTreeSettings(); bool impl_side_painting; + bool allow_antialiasing; bool throttle_frame_production; bool begin_frame_scheduling_enabled; bool using_synchronous_renderer_compositor; -- cgit v1.1