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-09-04 04:35:54 +0000
committergab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 04:35:54 +0000
commit96c4f1f0cb1589b5e1a5589bfc606c387aa962f1 (patch)
treef52bfa25f507ba3cc8ecf95c39fc87210ac15e4d /content/browser/gpu/compositor_util.cc
parentea52ba3d45e55c14261a320c37c882923eb2f424 (diff)
downloadchromium_src-96c4f1f0cb1589b5e1a5589bfc606c387aa962f1.zip
chromium_src-96c4f1f0cb1589b5e1a5589bfc606c387aa962f1.tar.gz
chromium_src-96c4f1f0cb1589b5e1a5589bfc606c387aa962f1.tar.bz2
Revert 221114 "Enable GPU blacklist in tests."
> Enable GPU blacklist in tests. > > Partial re-land of https://codereview.chromium.org/22198004/) -- Always enable FCM on Windows -- Part 1/3. > > On top of fixing some of the issues there; only lands the part that enables the GPU blacklist in tests as the former CL is too hard to land all at once. > > Also keeping --skip-gpu-data-loading around for now to be able to deal with failures caused in layout_tests by this on their own later (this needs to land ASAP and layout_tests don't need this ASAP). > > Another CL will follow to always enable FCM on non-blacklisted Windows machines. > > This part re-enables loading the blacklist in tests (and adds a content_browsertest to make sure that the configuration we expect to be testing is indeed the one we are testing -- this uncertainty is basically the only reason the blacklist was explicitly disabled before). > > This CL also cleans up compositor_util.cc which was enforcing the blacklist twice. > > The original plan was to do this only for Windows as Mac/Linux was causing trouble, but it turns out to be harder to do it only on Windows; so taking care of http://crbug.com/277242 in this CL too after all... > > BUG=233830, 267038, 190942, 277242 > TBR=jcivelli, piman > > Originally Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=219132 > Then Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=219159 > > Review URL: https://chromiumcodereview.appspot.com/23534006 TBR=gab@chromium.org Review URL: https://codereview.chromium.org/23775004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu/compositor_util.cc')
-rw-r--r--content/browser/gpu/compositor_util.cc25
1 files changed, 18 insertions, 7 deletions
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index 150005a..8afd0e9 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -6,7 +6,6 @@
#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"
@@ -37,6 +36,11 @@ bool CanDoAcceleratedCompositing() {
return true;
}
+bool IsForceCompositingModeBlacklisted() {
+ return GpuDataManager::GetInstance()->IsFeatureBlacklisted(
+ gpu::GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE);
+}
+
} // namespace
bool IsThreadedCompositingEnabled() {
@@ -45,17 +49,20 @@ 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;
- } else if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) {
+
+ if (command_line.HasSwitch(switches::kEnableThreadedCompositing))
return true;
- }
- if (!CanDoAcceleratedCompositing())
+ if (IsForceCompositingModeBlacklisted())
return false;
base::FieldTrial* trial =
@@ -70,15 +77,19 @@ 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;
- else if (command_line.HasSwitch(switches::kForceCompositingMode))
+
+ if (command_line.HasSwitch(switches::kForceCompositingMode))
return true;
- if (!CanDoAcceleratedCompositing())
+ if (IsForceCompositingModeBlacklisted())
return false;
base::FieldTrial* trial =