summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/gpu/compositor_util.cc30
-rw-r--r--content/browser/gpu/compositor_util_browsertest.cc4
2 files changed, 15 insertions, 19 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;
diff --git a/content/browser/gpu/compositor_util_browsertest.cc b/content/browser/gpu/compositor_util_browsertest.cc
index 2921bae..1a6fde9 100644
--- a/content/browser/gpu/compositor_util_browsertest.cc
+++ b/content/browser/gpu/compositor_util_browsertest.cc
@@ -34,10 +34,10 @@ IN_PROC_BROWSER_TEST_F(CompositorUtilTest, CompositingModeAsExpected) {
expected_mode = THREADED;
#elif defined(OS_MACOSX)
if (base::mac::IsOSMountainLionOrLater())
- expected_mode = ENABLED;
+ expected_mode = THREADED;
#elif defined(OS_WIN)
if (base::win::GetVersion() >= base::win::VERSION_VISTA)
- expected_mode = ENABLED;
+ expected_mode = THREADED;
#endif
EXPECT_EQ(expected_mode == ENABLED ||