0

Always enable FCM on Windows Vista+.

This is part 2/3 of re-landing https://codereview.chromium.org/22198004/.

It will land before part 1/3 @ https://codereview.chromium.org/23534006 because this part is core to getting Aura on the waterfall and part 1/3 has already been blocking us for too long.

We want to use the blacklist rather than hardcode OS versions in compositor_util, but for now hardcoding is fine...

TBR=zmo
BUG=233830, 267038

Review URL: https://chromiumcodereview.appspot.com/23874016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221643 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
gab@chromium.org
2013-09-06 08:21:18 +00:00
parent 374c7b238e
commit 7aa0d38198
3 changed files with 61 additions and 19 deletions

@ -6,11 +6,16 @@
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
#include "build/build_config.h"
#include "content/public/browser/gpu_data_manager.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_WIN)
#include "base/win/windows_version.h"
#endif
namespace content {
namespace {
@ -36,11 +41,6 @@ bool CanDoAcceleratedCompositing() {
return true;
}
bool IsForceCompositingModeBlacklisted() {
return GpuDataManager::GetInstance()->IsFeatureBlacklisted(
gpu::GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE);
}
} // namespace
bool IsThreadedCompositingEnabled() {
@ -49,20 +49,17 @@ bool IsThreadedCompositingEnabled() {
return true;
#endif
if (!CanDoAcceleratedCompositing())
return false;
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
// Command line switches take precedence over blacklist and field trials.
if (command_line.HasSwitch(switches::kDisableForceCompositingMode) ||
command_line.HasSwitch(switches::kDisableThreadedCompositing))
command_line.HasSwitch(switches::kDisableThreadedCompositing)) {
return false;
if (command_line.HasSwitch(switches::kEnableThreadedCompositing))
} else if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) {
return true;
}
if (IsForceCompositingModeBlacklisted())
if (!CanDoAcceleratedCompositing())
return false;
base::FieldTrial* trial =
@ -77,21 +74,29 @@ bool IsForceCompositingModeEnabled() {
return true;
#endif
if (!CanDoAcceleratedCompositing())
return false;
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
// Command line switches take precedence over blacklisting and field trials.
if (command_line.HasSwitch(switches::kDisableForceCompositingMode))
return false;
if (command_line.HasSwitch(switches::kForceCompositingMode))
else if (command_line.HasSwitch(switches::kForceCompositingMode))
return true;
if (IsForceCompositingModeBlacklisted())
if (!CanDoAcceleratedCompositing())
return false;
#if defined(OS_WIN)
// Windows Vista+ has been shipping with FCM enabled at 100% since M24; skip
// the field trial check to ensure this is always enabled on the try bots.
// TODO(gab): Do the same thing in IsThreadedCompositingEnabled() once this is
// stable.
// TODO(gab): Do the same thing for Mac OS (which has been enabled at 100%
// since M28) as well and get rid of the field trial code.
// TODO(gab): Use the GPU blacklist instead of hardcoding OS version here
// https://codereview.chromium.org/23534006.
return base::win::GetVersion() >= base::win::VERSION_VISTA;
#endif
base::FieldTrial* trial =
base::FieldTrialList::Find(kGpuCompositingFieldTrialName);

@ -0,0 +1,36 @@
// Copyright 2013 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.
#include "content/browser/gpu/compositor_util.h"
#include "content/test/content_browser_test.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#endif
namespace content {
typedef ContentBrowserTest CompositorUtilTest;
// Test that threaded compositing and FCM are in the expected mode on the bots
// for all platforms.
IN_PROC_BROWSER_TEST_F(CompositorUtilTest, CompositingModeAsExpected) {
enum CompositingMode {
DISABLED,
ENABLED,
THREADED,
} expected_mode = DISABLED;
#if defined(OS_ANDROID) || defined(USE_AURA)
expected_mode = THREADED;
#elif defined(OS_WIN)
if (base::win::GetVersion() >= base::win::VERSION_VISTA)
expected_mode = ENABLED;
#endif
EXPECT_EQ(expected_mode == ENABLED || expected_mode == THREADED,
IsForceCompositingModeEnabled());
EXPECT_EQ(expected_mode == THREADED, IsThreadedCompositingEnabled());
}
}

@ -813,10 +813,11 @@
'browser/download/mhtml_generation_browsertest.cc',
'browser/download/save_package_browsertest.cc',
'browser/fileapi/file_system_browsertest.cc',
'browser/gpu/compositor_util_browsertest.cc',
'browser/gpu/gpu_crash_browsertest.cc',
'browser/gpu/gpu_functional_browsertest.cc',
'browser/gpu/gpu_info_browsertest.cc',
'browser/gpu/gpu_ipc_browsertests.cc',
'browser/gpu/gpu_functional_browsertest.cc',
'browser/gpu/gpu_memory_test.cc',
'browser/gpu/gpu_pixel_browsertest.cc',
'browser/gpu/webgl_conformance_test.cc',