summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorvangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-02 20:46:04 +0000
committervangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-02 20:46:04 +0000
commit96ccc7ec1f107b74a697ced6d08c4150efb5c297 (patch)
treec5ee89dcf66dff38de42250f674221cb9a1c11bf /webkit
parent8d893510a0062ef20a6174bd58335a2b11c52b03 (diff)
downloadchromium_src-96ccc7ec1f107b74a697ced6d08c4150efb5c297.zip
chromium_src-96ccc7ec1f107b74a697ced6d08c4150efb5c297.tar.gz
chromium_src-96ccc7ec1f107b74a697ced6d08c4150efb5c297.tar.bz2
Adding a new command line flag (--enable-accelerated-layers) for turning
on the accelerated compositor for 3D CSS, Video, Plugins and Animations. Also the compositor will now always be enabled for WebGL and accelerated 2D canvas content. In addition, added an about:flags entry for the flag using the same name and description as our old "enable accelerated compositing" entry had, however triggering the new flag. This CL must be checked in after the patch for https://bugs.webkit.org/show_bug.cgi?id=50301 lands. BUG=64589 Review URL: http://codereview.chromium.org/5421001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webpreferences.cc21
-rw-r--r--webkit/glue/webpreferences.h1
2 files changed, 20 insertions, 2 deletions
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index 0688f25..afc39bd 100644
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -63,6 +63,7 @@ WebPreferences::WebPreferences()
experimental_webgl_enabled(false),
show_composited_layer_borders(false),
accelerated_compositing_enabled(false),
+ accelerated_layers_enabled(false),
accelerated_2d_canvas_enabled(false),
memory_info_enabled(false) {
}
@@ -140,8 +141,9 @@ void WebPreferences::Apply(WebView* web_view) const {
// Enable experimental WebGL support if requested on command line
// and support is compiled in.
- settings->setExperimentalWebGLEnabled(
- WebRuntimeFeatures::isWebGLEnabled() || experimental_webgl_enabled);
+ bool enable_webgl =
+ WebRuntimeFeatures::isWebGLEnabled() || experimental_webgl_enabled;
+ settings->setExperimentalWebGLEnabled(enable_webgl);
// Display colored borders around composited render layers if requested
// on command line.
@@ -153,6 +155,21 @@ void WebPreferences::Apply(WebView* web_view) const {
// Enable gpu-accelerated 2d canvas if requested on the command line.
settings->setAccelerated2dCanvasEnabled(accelerated_2d_canvas_enabled);
+ // Enabling accelerated layers from the command line enabled accelerated
+ // 3D CSS, Video, Plugins, and Animations.
+ settings->setAcceleratedCompositingFor3DTransformsEnabled(
+ accelerated_layers_enabled);
+ settings->setAcceleratedCompositingForVideoEnabled(
+ accelerated_layers_enabled);
+ settings->setAcceleratedCompositingForPluginsEnabled(
+ accelerated_layers_enabled);
+ settings->setAcceleratedCompositingForAnimationEnabled(
+ accelerated_layers_enabled);
+
+ // WebGL and accelerated 2D canvas are always gpu composited.
+ settings->setAcceleratedCompositingForCanvasEnabled(
+ enable_webgl || accelerated_2d_canvas_enabled);
+
// Enable memory info reporting to page if requested on the command line.
settings->setMemoryInfoEnabled(memory_info_enabled);
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index 2f765b2..6cb8044 100644
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -67,6 +67,7 @@ struct WebPreferences {
bool experimental_webgl_enabled;
bool show_composited_layer_borders;
bool accelerated_compositing_enabled;
+ bool accelerated_layers_enabled;
bool accelerated_2d_canvas_enabled;
bool memory_info_enabled;