summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 19:10:43 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-07 19:10:43 +0000
commit186bf92abfcce5136acb040c301959ff6ca96028 (patch)
tree61f7e1d3ff062f6e0cbc43860ccbda5e6fa2d2ca
parent62179a9fc046ec14891d32fbd5f97e6af6f2f896 (diff)
downloadchromium_src-186bf92abfcce5136acb040c301959ff6ca96028.zip
chromium_src-186bf92abfcce5136acb040c301959ff6ca96028.tar.gz
chromium_src-186bf92abfcce5136acb040c301959ff6ca96028.tar.bz2
Added a command-line flag to enable h/w accelerated rendering of content layers.
R=tony@chromium.org,darin@chromium.org Review URL: http://codereview.chromium.org/6726005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80822 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/tab_contents/render_view_host_delegate_helper.cc3
-rw-r--r--content/common/content_switches.cc6
-rw-r--r--content/common/content_switches.h1
-rw-r--r--content/common/view_messages.h1
-rw-r--r--webkit/glue/webpreferences.cc4
-rw-r--r--webkit/glue/webpreferences.h1
6 files changed, 16 insertions, 0 deletions
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 d38941e..3e07003 100644
--- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
+++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc
@@ -300,6 +300,9 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs(
web_prefs.accelerated_2d_canvas_enabled =
gpu_enabled() &&
command_line.HasSwitch(switches::kEnableAccelerated2dCanvas);
+ web_prefs.accelerated_drawing_enabled =
+ gpu_enabled() &&
+ command_line.HasSwitch(switches::kEnableAcceleratedDrawing);
web_prefs.accelerated_layers_enabled =
!command_line.HasSwitch(switches::kDisableAcceleratedLayers);
web_prefs.composite_to_texture_enabled =
diff --git a/content/common/content_switches.cc b/content/common/content_switches.cc
index 1232131..1197a91 100644
--- a/content/common/content_switches.cc
+++ b/content/common/content_switches.cc
@@ -69,6 +69,12 @@ const char kDisableSeccompSandbox[] = "disable-seccomp-sandbox";
// Disable Web Sockets support.
const char kDisableWebSockets[] = "disable-web-sockets";
+// Enable hardware accelerated page drawing.
+// Please note that this flag is honored only if chromium is compiled with
+// SKIA_GPU flag, which can be enabled by setting use_skia_gpu variable to 1
+// in build/features_override.gypi.
+const char kEnableAcceleratedDrawing[] = "enable-accelerated-drawing";
+
// Enables the benchmarking extensions.
const char kEnableBenchmarking[] = "enable-benchmarking";
diff --git a/content/common/content_switches.h b/content/common/content_switches.h
index 61fc6cc..d7ac513 100644
--- a/content/common/content_switches.h
+++ b/content/common/content_switches.h
@@ -29,6 +29,7 @@ extern const char kDisablePlugins[];
extern const char kDisablePopupBlocking[];
extern const char kDisableSeccompSandbox[];
extern const char kDisableWebSockets[];
+extern const char kEnableAcceleratedDrawing[];
extern const char kEnableBenchmarking[];
extern const char kEnableGPUPlugin[];
extern const char kEnableLogging[];
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 2ff791d..c397f62 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -308,6 +308,7 @@ IPC_STRUCT_TRAITS_BEGIN(WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(force_compositing_mode)
IPC_STRUCT_TRAITS_MEMBER(composite_to_texture_enabled)
IPC_STRUCT_TRAITS_MEMBER(accelerated_2d_canvas_enabled)
+ IPC_STRUCT_TRAITS_MEMBER(accelerated_drawing_enabled)
IPC_STRUCT_TRAITS_MEMBER(accelerated_plugins_enabled)
IPC_STRUCT_TRAITS_MEMBER(accelerated_layers_enabled)
IPC_STRUCT_TRAITS_MEMBER(accelerated_video_enabled)
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index e54c199..a7817a1 100644
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -73,6 +73,7 @@ WebPreferences::WebPreferences()
accelerated_layers_enabled(false),
accelerated_video_enabled(false),
accelerated_2d_canvas_enabled(false),
+ accelerated_drawing_enabled(false),
accelerated_plugins_enabled(false),
memory_info_enabled(false),
interactive_form_validation_enabled(true),
@@ -183,6 +184,9 @@ void WebPreferences::Apply(WebView* web_view) const {
// Enable gpu-accelerated 2d canvas if requested on the command line.
settings->setAccelerated2dCanvasEnabled(accelerated_2d_canvas_enabled);
+ // Enable gpu-accelerated drawing if requested on the command line.
+ settings->setAcceleratedDrawingEnabled(accelerated_drawing_enabled);
+
// Enabling accelerated layers from the command line enabled accelerated
// 3D CSS, Video, and Animations.
settings->setAcceleratedCompositingFor3DTransformsEnabled(
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index c373504..f2ab807 100644
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -79,6 +79,7 @@ struct WebPreferences {
bool accelerated_layers_enabled;
bool accelerated_video_enabled;
bool accelerated_2d_canvas_enabled;
+ bool accelerated_drawing_enabled;
bool accelerated_plugins_enabled;
bool memory_info_enabled;
bool interactive_form_validation_enabled;