summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhartmanng@chromium.org <hartmanng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-17 15:56:08 +0000
committerhartmanng@chromium.org <hartmanng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-17 15:56:08 +0000
commit2afdb07c3dbb7929adb1f5a86b55f39074808a4a (patch)
tree337ea5aebce94ecc8911100c903852328f7fccf5
parent052e067a82595c3f9c0ab6b073e61009f031da58 (diff)
downloadchromium_src-2afdb07c3dbb7929adb1f5a86b55f39074808a4a.zip
chromium_src-2afdb07c3dbb7929adb1f5a86b55f39074808a4a.tar.gz
chromium_src-2afdb07c3dbb7929adb1f5a86b55f39074808a4a.tar.bz2
Add enable-accelerated-compositing-for-overflow-scroll switch.
This is to turn on https://bugs.webkit.org/show_bug.cgi?id=94743. BUG=None Review URL: https://chromiumcodereview.appspot.com/10918079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157123 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/web_contents/web_contents_impl.cc3
-rw-r--r--content/common/view_messages.h1
-rw-r--r--content/public/common/content_switches.cc5
-rw-r--r--content/public/common/content_switches.h1
-rw-r--r--webkit/glue/webpreferences.cc5
-rw-r--r--webkit/glue/webpreferences.h1
6 files changed, 16 insertions, 0 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 1bd9332..54a5e17 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -490,6 +490,9 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
command_line.HasSwitch(switches::kShowCompositedLayerTree);
prefs.show_fps_counter =
command_line.HasSwitch(switches::kShowFPSCounter);
+ prefs.accelerated_compositing_for_overflow_scroll_enabled =
+ command_line.HasSwitch(
+ switches::kEnableAcceleratedCompositingForOverflowScroll);
prefs.show_paint_rects =
command_line.HasSwitch(switches::kShowPaintRects);
prefs.render_vsync_enabled =
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 422776d..3596609 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -187,6 +187,7 @@ IPC_STRUCT_TRAITS_BEGIN(webkit_glue::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(show_composited_layer_borders)
IPC_STRUCT_TRAITS_MEMBER(show_composited_layer_tree)
IPC_STRUCT_TRAITS_MEMBER(show_fps_counter)
+ IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_overflow_scroll_enabled)
IPC_STRUCT_TRAITS_MEMBER(show_paint_rects)
IPC_STRUCT_TRAITS_MEMBER(render_vsync_enabled)
IPC_STRUCT_TRAITS_MEMBER(asynchronous_spell_checking_enabled)
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 6f1ca1c..0026aa8 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -552,6 +552,11 @@ const char kShowCompositedLayerTree[] = "show-composited-layer-tree";
// Draws a FPS indicator
const char kShowFPSCounter[] = "show-fps-counter";
+// Enables accelerated compositing for overflow scroll. Promotes eligible
+// overflow:scroll elements to layers to enable accelerated scrolling for them.
+const char kEnableAcceleratedCompositingForOverflowScroll[] =
+ "enable-accelerated-compositing-for-overflow-scroll";
+
// Visibly render a border around paint rects in the web page to help debug
// and study painting behavior.
const char kShowPaintRects[] = "show-paint-rects";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 4c25780..cdeff20 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -174,6 +174,7 @@ CONTENT_EXPORT extern const char kServiceProcess[];
extern const char kShowCompositedLayerBorders[];
extern const char kShowCompositedLayerTree[];
extern const char kShowFPSCounter[];
+extern const char kEnableAcceleratedCompositingForOverflowScroll[];
extern const char kShowPaintRects[];
CONTENT_EXPORT extern const char kSimulateTouchScreenWithMouse[];
CONTENT_EXPORT extern const char kSingleProcess[];
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index 3e16063..ea9992e 100644
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -78,6 +78,7 @@ WebPreferences::WebPreferences()
show_composited_layer_borders(false),
show_composited_layer_tree(false),
show_fps_counter(false),
+ accelerated_compositing_for_overflow_scroll_enabled(false),
show_paint_rects(false),
render_vsync_enabled(true),
asynchronous_spell_checking_enabled(true),
@@ -309,6 +310,10 @@ void WebPreferences::Apply(WebView* web_view) const {
// Display an FPS indicator if requested on the command line.
settings->setShowFPSCounter(show_fps_counter);
+ // Enables accelerated compositing for overflow scroll.
+ settings->setAcceleratedCompositingForOverflowScrollEnabled(
+ accelerated_compositing_for_overflow_scroll_enabled);
+
// Display the current compositor tree as overlay if requested on
// the command line
settings->setShowPlatformLayerTree(show_composited_layer_tree);
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index c414a5e..0e387f5ea 100644
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -95,6 +95,7 @@ struct WEBKIT_GLUE_EXPORT WebPreferences {
bool show_composited_layer_borders;
bool show_composited_layer_tree;
bool show_fps_counter;
+ bool accelerated_compositing_for_overflow_scroll_enabled;
bool show_paint_rects;
bool render_vsync_enabled;
bool asynchronous_spell_checking_enabled;