summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/base/switches.cc4
-rw-r--r--cc/base/switches.h1
-rw-r--r--cc/output/gl_renderer.cc6
-rw-r--r--cc/output/software_renderer.cc3
-rw-r--r--cc/trees/layer_tree_settings.cc1
-rw-r--r--cc/trees/layer_tree_settings.h1
-rw-r--r--chrome/browser/chromeos/login/chrome_restart_request.cc1
-rw-r--r--content/browser/renderer_host/compositor_impl_android.cc1
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc1
-rw-r--r--content/renderer/gpu/render_widget_compositor.cc2
10 files changed, 18 insertions, 3 deletions
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;
diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc
index 48f66b1..d8f2671 100644
--- a/chrome/browser/chromeos/login/chrome_restart_request.cc
+++ b/chrome/browser/chromeos/login/chrome_restart_request.cc
@@ -151,6 +151,7 @@ std::string DeriveCommandLine(const GURL& start_url,
// content/browser/renderer_host/render_process_host_impl.cc.
cc::switches::kBackgroundColorInsteadOfCheckerboard,
cc::switches::kCompositeToMailbox,
+ cc::switches::kDisableCompositedAntialiasing,
cc::switches::kDisableImplSidePainting,
cc::switches::kDisableThreadedAnimation,
cc::switches::kEnableImplSidePainting,
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 739c18d..02a903f 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -234,6 +234,7 @@ void CompositorImpl::SetVisible(bool visible) {
settings.compositor_name = "BrowserCompositor";
settings.refresh_rate = 60.0;
settings.impl_side_painting = false;
+ settings.allow_antialiasing = false;
settings.calculate_top_controls_position = false;
settings.top_controls_height = 0.f;
settings.use_memory_management = false;
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 931e47d..4345fa4 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1034,6 +1034,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
// also be added to chrome/browser/chromeos/login/chrome_restart_request.cc.
cc::switches::kBackgroundColorInsteadOfCheckerboard,
cc::switches::kCompositeToMailbox,
+ cc::switches::kDisableCompositedAntialiasing,
cc::switches::kDisableImplSidePainting,
cc::switches::kDisableThreadedAnimation,
cc::switches::kEnableImplSidePainting,
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 06dc3f3..da32d22 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -185,6 +185,8 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create(
cmd->HasSwitch(cc::switches::kTraceOverdraw);
settings.use_pinch_virtual_viewport =
cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport);
+ settings.allow_antialiasing &=
+ !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing);
// These flags should be mirrored by UI versions in ui/compositor/.
settings.initial_debug_state.show_debug_borders =