Index: chrome/browser/gpu_util.cc |
=================================================================== |
--- chrome/browser/gpu_util.cc (revision 140632) |
+++ chrome/browser/gpu_util.cc (working copy) |
@@ -7,6 +7,7 @@ |
#include <vector> |
#include "base/command_line.h" |
+#include "base/metrics/field_trial.h" |
#include "base/metrics/histogram.h" |
#include "base/string_number_conversions.h" |
#include "base/string_util.h" |
@@ -14,6 +15,7 @@ |
#include "base/sys_info.h" |
#include "base/values.h" |
#include "base/version.h" |
+#include "chrome/browser/browser_trial.h" |
#include "chrome/browser/gpu_blacklist.h" |
#include "content/public/browser/gpu_data_manager.h" |
#include "content/public/common/content_switches.h" |
@@ -203,6 +205,17 @@ |
return JoinString(matches, ','); |
} |
+bool InForceCompositingFieldTrial() { |
SteveT
2012/06/06 13:06:02
nit: Indent is 4 here instead of 2.
|
+ base::FieldTrial* trial = |
+ base::FieldTrialList::Find(BrowserTrial::kForceCompositingModeTrial); |
+ if (!trial) |
+ return false; |
Ilya Sherman
2012/06/06 09:50:21
Can this be a DCHECK rather than an if-stmt? (See
|
+ if (trial->group_name() != std::string("enable")) |
Ilya Sherman
2012/06/06 09:50:21
nit: return trial->group_name() == "enable";
|
+ return false; |
+ |
+ return true; |
+} |
+ |
Value* GetFeatureStatus() { |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
bool gpu_access_blocked = !GpuDataManager::GetInstance()->GpuAccessAllowed(); |
@@ -314,8 +327,9 @@ |
(!CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kDisableThreadedCompositing)); |
if (kGpuFeatureInfo[i].name == "compositing" && |
- CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kForceCompositingMode)) |
+ (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kForceCompositingMode) || |
+ InForceCompositingFieldTrial())) |
Ilya Sherman
2012/06/06 09:50:21
Will the field trial always be set up by the time
|
status += "_force"; |
if (kGpuFeatureInfo[i].name == "compositing" && |
has_thread) |