Add a flag for enabling/disabling the new accelerated scrolling path
Relanding. This patch had previously been reverted because opting into the new path could run us into bugs. All known bugs have been resolved, so this should be safe to land.
We now have two accelerated scrolling paths. One accelerates scrolling whenever
it's safe to promote the overflow scrolling div to a stacking container /
containing block and not break stacking or clipping.
The new path, the 'universal' path, enables accelerated scrolling in those cases
where the old path would not opt-in.
Eventually, we'd like to eliminate the old path, but this will require layer
squashing (the new path can result in many composited layers that ought to be
combined -- i.e., a 'layer explosion'). Until these paths are mature, we need to
be able to enable and disable them both, so we have two separate sets of flags.
Once we've eliminated the old path, we can replace both with
--[enable/disable]-accelerated-overflow-scroll (and eventually get rid of both
sets of flags).
BUG=None
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=228187
[email protected], [email protected], [email protected]
Review URL: https://codereview.chromium.org/26809004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229421 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 60a8bb2..a590c2ee 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -533,6 +533,14 @@
if (command_line.HasSwitch(switches::kDisableCompositedScrollingForFrames))
prefs.composited_scrolling_for_frames_enabled = false;
+ prefs.universal_accelerated_compositing_for_overflow_scroll_enabled = false;
+ if (command_line.HasSwitch(
+ switches::kEnableUniversalAcceleratedOverflowScroll))
+ prefs.universal_accelerated_compositing_for_overflow_scroll_enabled = true;
+ if (command_line.HasSwitch(
+ switches::kDisableUniversalAcceleratedOverflowScroll))
+ prefs.universal_accelerated_compositing_for_overflow_scroll_enabled = false;
+
prefs.show_paint_rects =
command_line.HasSwitch(switches::kShowPaintRects);
prefs.accelerated_compositing_enabled =