diff options
author | sievers@google.com <sievers@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-21 19:20:40 +0000 |
---|---|---|
committer | sievers@google.com <sievers@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-21 19:20:40 +0000 |
commit | f07aabbfcee06d7e89c3da43cd58de4dfd5f315a (patch) | |
tree | 7d16f23c39416a6241653389359ec7b97c665e40 | |
parent | 4460ee53d9a79830f9445778d6473a49a22c4ba6 (diff) | |
download | chromium_src-f07aabbfcee06d7e89c3da43cd58de4dfd5f315a.zip chromium_src-f07aabbfcee06d7e89c3da43cd58de4dfd5f315a.tar.gz chromium_src-f07aabbfcee06d7e89c3da43cd58de4dfd5f315a.tar.bz2 |
Support for '--force-compositing-mode', see WebKit bug 56156
BUG=
TEST=
Review URL: http://codereview.chromium.org/6665057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78904 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/tab_contents/render_view_host_delegate_helper.cc | 2 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/common/render_messages.cc | 2 | ||||
-rw-r--r-- | webkit/glue/webpreferences.cc | 6 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 3 |
6 files changed, 16 insertions, 2 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 f5d686b..f88dddb 100644 --- a/chrome/browser/tab_contents/render_view_host_delegate_helper.cc +++ b/chrome/browser/tab_contents/render_view_host_delegate_helper.cc @@ -293,6 +293,8 @@ WebPreferences RenderViewHostDelegateHelper::GetWebkitPrefs( web_prefs.accelerated_compositing_enabled = gpu_enabled() && !command_line.HasSwitch(switches::kDisableAcceleratedCompositing); + web_prefs.force_compositing_mode = + command_line.HasSwitch(switches::kForceCompositingMode); web_prefs.accelerated_2d_canvas_enabled = gpu_enabled() && command_line.HasSwitch(switches::kEnableAccelerated2dCanvas); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 01e4d6a..7286e94 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -611,6 +611,10 @@ const char kFirstRun[] = "first-run"; // timed out, etc. Useful for testing. const char kForceAppsPromoVisible[] = "force-apps-promo-visible"; +// If accelerated compositing is supported, always enter compositing mode for +// the base layer even when compositing is not strictly required. +const char kForceCompositingMode[] = "force-compositing-mode"; + // Some field tests may rendomized in the browser, and the randomly selected // outcome needs to be propogated to the renderer. For instance, this is used // to modify histograms recorded in the renderer, or to get the renderer to diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index e7bc4da..7550cff 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -182,6 +182,7 @@ extern const char kFileDescriptorLimit[]; extern const char kFocusExistingTabOnOpen[]; extern const char kFirstRun[]; extern const char kForceAppsPromoVisible[]; +extern const char kForceCompositingMode[]; extern const char kForceFieldTestNameAndValue[]; extern const char kForceRendererAccessibility[]; extern const char kForceStubLibcros[]; diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc index c05d761..52d7280 100644 --- a/chrome/common/render_messages.cc +++ b/chrome/common/render_messages.cc @@ -410,6 +410,7 @@ void ParamTraits<WebPreferences>::Write(Message* m, const param_type& p) { WriteParam(m, p.show_composited_layer_tree); WriteParam(m, p.show_fps_counter); WriteParam(m, p.accelerated_compositing_enabled); + WriteParam(m, p.force_compositing_mode); WriteParam(m, p.composite_to_texture_enabled); WriteParam(m, p.accelerated_2d_canvas_enabled); WriteParam(m, p.accelerated_plugins_enabled); @@ -470,6 +471,7 @@ bool ParamTraits<WebPreferences>::Read(const Message* m, void** iter, ReadParam(m, iter, &p->show_composited_layer_tree) && ReadParam(m, iter, &p->show_fps_counter) && ReadParam(m, iter, &p->accelerated_compositing_enabled) && + ReadParam(m, iter, &p->force_compositing_mode) && ReadParam(m, iter, &p->composite_to_texture_enabled) && ReadParam(m, iter, &p->accelerated_2d_canvas_enabled) && ReadParam(m, iter, &p->accelerated_plugins_enabled) && diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index ab359a2..116d43d 100644 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -68,6 +68,7 @@ WebPreferences::WebPreferences() show_fps_counter(false), asynchronous_spell_checking_enabled(true), accelerated_compositing_enabled(false), + force_compositing_mode(false), composite_to_texture_enabled(false), accelerated_layers_enabled(false), accelerated_video_enabled(false), @@ -175,6 +176,9 @@ void WebPreferences::Apply(WebView* web_view) const { // Enable gpu-accelerated compositing if requested on the command line. settings->setAcceleratedCompositingEnabled(accelerated_compositing_enabled); + // Always enter compositing if requested on the command line. + settings->setForceCompositingMode(force_compositing_mode); + // Enable composite to offscreen texture if requested on the command line. settings->setCompositeToTextureEnabled(composite_to_texture_enabled); diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index 0d37d39..c373504 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -74,6 +74,7 @@ struct WebPreferences { bool show_fps_counter; bool asynchronous_spell_checking_enabled; bool accelerated_compositing_enabled; + bool force_compositing_mode; bool composite_to_texture_enabled; bool accelerated_layers_enabled; bool accelerated_video_enabled; |