summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--chrome/browser/about_flags.cc16
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc2
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/render_messages.cc2
-rw-r--r--webkit/glue/webpreferences.cc21
-rw-r--r--webkit/glue/webpreferences.h1
7 files changed, 35 insertions, 11 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index fec86c4..b46a101 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -201,15 +201,13 @@ const Experiment kExperiments[] = {
kOsMac,
SINGLE_VALUE_TYPE(switches::kEnablePredictiveInstant)
},
- // FIXME(scheib): Add Flags entry for accelerated Compositing,
- // or pull it and the strings in generated_resources.grd by Dec 2010
- // {
- // "gpu-compositing",
- // IDS_FLAGS_ACCELERATED_COMPOSITING_NAME,
- // IDS_FLAGS_ACCELERATED_COMPOSITING_DESCRIPTION,
- // kOsAll,
- // SINGLE_VALUE_TYPE(switches::kDisableAcceleratedCompositing)
- // },
+ {
+ "gpu-compositing",
+ IDS_FLAGS_ACCELERATED_COMPOSITING_NAME,
+ IDS_FLAGS_ACCELERATED_COMPOSITING_DESCRIPTION,
+ kOsAll,
+ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedLayers)
+ },
{
"gpu-canvas-2d", // FLAGS:RECORD_UMA
IDS_FLAGS_ACCELERATED_CANVAS_2D_NAME,
diff --git a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
index 707080b3..c7f59ff 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -287,6 +287,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
web_prefs.accelerated_2d_canvas_enabled =
gpu_enabled() &&
command_line.HasSwitch(switches::kEnableAccelerated2dCanvas);
+ web_prefs.accelerated_layers_enabled =
+ command_line.HasSwitch(switches::kEnableAcceleratedLayers);
web_prefs.memory_info_enabled =
command_line.HasSwitch(switches::kEnableMemoryInfo);
web_prefs.hyperlink_auditing_enabled =
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 33cfe75..be4e83d 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -387,6 +387,9 @@ extern const char kLogNetLog[] = "log-net-log";
// Enable gpu-accelerated 2d canvas.
const char kEnableAccelerated2dCanvas[] = "enable-accelerated-2d-canvas";
+// Enables the hardware acceleration of 3D CSS, Video and animation.
+const char kEnableAcceleratedLayers[] = "enable-accelerated-layers";
+
// Enables WebKit accessibility within the renderer process.
const char kEnableAccessibility[] = "enable-accessibility";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 26c79bf..8c3ecaf 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -118,6 +118,7 @@ extern const char kDnsServer[];
extern const char kDomAutomationController[];
extern const char kDumpHistogramsOnExit[];
extern const char kEnableAccelerated2dCanvas[];
+extern const char kEnableAcceleratedLayers[];
extern const char kEnableAccessibility[];
extern const char kEnableAeroPeekTabs[];
extern const char kEnableAppLauncher[];
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index 1df6c3a..be20600 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -736,6 +736,7 @@ void ParamTraits<WebPreferences>::Write(Message* m, const param_type& p) {
WriteParam(m, p.show_composited_layer_borders);
WriteParam(m, p.accelerated_compositing_enabled);
WriteParam(m, p.accelerated_2d_canvas_enabled);
+ WriteParam(m, p.accelerated_layers_enabled);
WriteParam(m, p.memory_info_enabled);
}
@@ -786,6 +787,7 @@ bool ParamTraits<WebPreferences>::Read(const Message* m, void** iter,
ReadParam(m, iter, &p->show_composited_layer_borders) &&
ReadParam(m, iter, &p->accelerated_compositing_enabled) &&
ReadParam(m, iter, &p->accelerated_2d_canvas_enabled) &&
+ ReadParam(m, iter, &p->accelerated_layers_enabled) &&
ReadParam(m, iter, &p->memory_info_enabled);
}
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;