summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu/compositor_util.cc
diff options
context:
space:
mode:
authorgab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-30 23:13:14 +0000
committergab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-30 23:13:14 +0000
commiteab9db7195984db6e13bfd800a83e6787abb6e05 (patch)
tree62c209a503c15b55f4a998bae72b94bbe374f602 /content/browser/gpu/compositor_util.cc
parentad412952e91cacc7291da0ae47cfe15ae020a57d (diff)
downloadchromium_src-eab9db7195984db6e13bfd800a83e6787abb6e05.zip
chromium_src-eab9db7195984db6e13bfd800a83e6787abb6e05.tar.gz
chromium_src-eab9db7195984db6e13bfd800a83e6787abb6e05.tar.bz2
Statically enable TCM and get rid of compositing-mode-field-trials.
This is based on top of https://codereview.chromium.org/27197009/ BUG=302738, 233830, 306557 Originally Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=229806 Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=229907 Review URL: https://codereview.chromium.org/26389003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu/compositor_util.cc')
-rw-r--r--content/browser/gpu/compositor_util.cc30
1 files changed, 13 insertions, 17 deletions
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index 263d9b5..32d5f7a 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -5,20 +5,13 @@
#include "content/browser/gpu/compositor_util.h"
#include "base/command_line.h"
-#include "base/metrics/field_trial.h"
+#include "base/logging.h"
#include "build/build_config.h"
#include "cc/base/switches.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
-#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "gpu/config/gpu_feature_type.h"
-#if defined(OS_MACOSX)
-#include "base/mac/mac_util.h"
-#elif defined(OS_WIN)
-#include "base/win/windows_version.h"
-#endif
-
namespace content {
namespace {
@@ -186,7 +179,7 @@ const GpuFeatureInfo GetGpuFeatureInfo(size_t index) {
bool CanDoAcceleratedCompositing() {
const GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
- // Don't run the field trial if gpu access has been blocked or
+ // Don't use force compositing mode if gpu access has been blocked or
// accelerated compositing is blacklisted.
if (!manager->GpuAccessAllowed(NULL) ||
manager->IsFeatureBlacklisted(
@@ -219,7 +212,7 @@ bool IsThreadedCompositingEnabled() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- // Command line switches take precedence over blacklist and field trials.
+ // Command line switches take precedence over blacklist.
if (command_line.HasSwitch(switches::kDisableForceCompositingMode) ||
command_line.HasSwitch(switches::kDisableThreadedCompositing)) {
return false;
@@ -230,10 +223,14 @@ bool IsThreadedCompositingEnabled() {
if (!CanDoAcceleratedCompositing() || IsForceCompositingModeBlacklisted())
return false;
- base::FieldTrial* trial =
- base::FieldTrialList::Find(kGpuCompositingFieldTrialName);
- return trial &&
- trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName;
+#if defined(OS_MACOSX) || defined(OS_WIN)
+ // Windows Vista+ has been shipping with TCM enabled at 100% since M24 and
+ // Mac OSX 10.8+ since M28. The blacklist check above takes care of returning
+ // false before this hits on unsupported Win/Mac versions.
+ return true;
+#endif
+
+ return false;
}
bool IsForceCompositingModeEnabled() {
@@ -243,7 +240,7 @@ bool IsForceCompositingModeEnabled() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- // Command line switches take precedence over blacklisting and field trials.
+ // Command line switches take precedence over blacklisting.
if (command_line.HasSwitch(switches::kDisableForceCompositingMode))
return false;
else if (command_line.HasSwitch(switches::kForceCompositingMode))
@@ -252,9 +249,8 @@ bool IsForceCompositingModeEnabled() {
if (!CanDoAcceleratedCompositing() || IsForceCompositingModeBlacklisted())
return false;
-// TODO(gab): Do the same thing for TCM above once this is stable.
#if defined(OS_MACOSX) || defined(OS_WIN)
- // Windows Vista+ has been shipping with FCM enabled at 100% since M24 and
+ // Windows Vista+ has been shipping with TCM enabled at 100% since M24 and
// Mac OSX 10.8+ since M28. The blacklist check above takes care of returning
// false before this hits on unsupported Win/Mac versions.
return true;