summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu
diff options
context:
space:
mode:
authorskaslev@chromium.org <skaslev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 22:04:09 +0000
committerskaslev@chromium.org <skaslev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 22:04:09 +0000
commit37dc90f4f95b4a00881ca6263faa1d6b6e0d8bbe (patch)
tree86e05cf11ea050dab2562b56aacd3e61a5b02fe6 /content/browser/gpu
parentb794505a14a83d2c162bf2979a36b39ce748229c (diff)
downloadchromium_src-37dc90f4f95b4a00881ca6263faa1d6b6e0d8bbe.zip
chromium_src-37dc90f4f95b4a00881ca6263faa1d6b6e0d8bbe.tar.gz
chromium_src-37dc90f4f95b4a00881ca6263faa1d6b6e0d8bbe.tar.bz2
Clean up software compositing switches.
After this patch just --disable-gpu should be enough to put Chrome in software compositing mode for Aura builds. NOTRY=true BUG=229712, 230120 Review URL: https://chromiumcodereview.appspot.com/13985036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu')
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.cc25
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.h6
2 files changed, 30 insertions, 1 deletions
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index e6fc470..f9b2f3e 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -20,6 +20,7 @@
#include "base/sys_info.h"
#include "base/values.h"
#include "base/version.h"
+#include "cc/base/switches.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/gpu/gpu_util.h"
#include "content/common/gpu/gpu_messages.h"
@@ -421,6 +422,11 @@ void GpuDataManagerImpl::AppendRendererCommandLine(
command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode);
if (ShouldUseSwiftShader())
command_line->AppendSwitch(switches::kDisableFlashFullscreen3d);
+
+ if (card_blacklisted_ && use_software_compositor_) {
+ command_line->AppendSwitch(switches::kEnableSoftwareCompositing);
+ command_line->AppendSwitch(cc::switches::kEnableCompositorFrameMessage);
+ }
}
void GpuDataManagerImpl::AppendGpuCommandLine(
@@ -570,6 +576,12 @@ void GpuDataManagerImpl::UpdateRendererWebPrefs(
prefs->accelerated_compositing_for_3d_transforms_enabled = false;
prefs->accelerated_compositing_for_plugins_enabled = false;
}
+
+ if (card_blacklisted_ && use_software_compositor_) {
+ prefs->accelerated_compositing_enabled = true;
+ prefs->accelerated_compositing_for_3d_transforms_enabled = true;
+ prefs->accelerated_compositing_for_animation_enabled = true;
+ }
}
GpuSwitchingOption GpuDataManagerImpl::GetGpuSwitchingOption() const {
@@ -584,6 +596,10 @@ void GpuDataManagerImpl::DisableHardwareAcceleration() {
for (int i = 0; i < NUMBER_OF_GPU_FEATURE_TYPES; ++i)
blacklisted_features_.insert(i);
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (!command_line->HasSwitch(switches::kDisableGpu))
+ command_line->AppendSwitch(switches::kDisableGpu);
+
EnableSwiftShaderIfNecessary();
NotifyGpuInfoUpdate();
}
@@ -686,6 +702,11 @@ GpuDataManagerImpl::GpuDataManagerImpl()
: complete_gpu_info_already_requested_(false),
gpu_switching_(GPU_SWITCHING_OPTION_AUTOMATIC),
observer_list_(new GpuDataManagerObserverList),
+#if defined(USE_AURA)
+ use_software_compositor_(true),
+#else
+ use_software_compositor_(false),
+#endif
use_swiftshader_(false),
card_blacklisted_(false),
update_histograms_(true),
@@ -810,6 +831,10 @@ void GpuDataManagerImpl::EnableSwiftShaderIfNecessary() {
}
}
+void GpuDataManagerImpl::EnableSoftwareCompositing() {
+ use_software_compositor_ = true;
+}
+
std::string GpuDataManagerImpl::GetDomainFromURL(const GURL& url) const {
// For the moment, we just use the host, or its IP address, as the
// entry in the set, rather than trying to figure out the top-level
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index 0bca69b..9683e89 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -89,6 +89,7 @@ class CONTENT_EXPORT GpuDataManagerImpl
std::string* gl_renderer,
std::string* gl_version) OVERRIDE;
virtual void DisableHardwareAcceleration() OVERRIDE;
+ virtual void EnableSoftwareCompositing() OVERRIDE;
// This collects preliminary GPU info, load GpuBlacklist, and compute the
// preliminary blacklisted features; it should only be called at browser
@@ -273,8 +274,11 @@ class CONTENT_EXPORT GpuDataManagerImpl
ListValue log_messages_;
mutable base::Lock log_messages_lock_;
- bool use_swiftshader_;
+ // TODO(skaslev) Remove this after all legacy s/w rendering paths are removed.
+ // Then use_software_compositor_ will be implicitly always true.
+ bool use_software_compositor_;
+ bool use_swiftshader_;
base::FilePath swiftshader_path_;
// Current card force-blacklisted due to GPU crashes, or disabled through