Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Unified Diff: chrome/browser/chrome_gpu_util.cc

Issue 10944037: Add field trial for enabling Stage3D in XP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_gpu_util.cc
diff --git a/chrome/browser/chrome_gpu_util.cc b/chrome/browser/chrome_gpu_util.cc
index 90efc1246768600b631690ea153dc4a5f08a06d2..d5097665d16e6ca35b4e6ff6e791fdead06e2b58 100644
--- a/chrome/browser/chrome_gpu_util.cc
+++ b/chrome/browser/chrome_gpu_util.cc
@@ -122,6 +122,43 @@ void InitializeCompositingFieldTrial() {
UMA_HISTOGRAM_BOOLEAN("GPU.InCompositorThreadFieldTrial", thread);
}
+bool ShouldRunStage3DFieldTrial() {
+#if !defined(OS_WIN)
+ return false;
+#else
+ if (base::win::GetVersion() >= base::win::VERSION_VISTA)
+ return false;
+ return true;
+#endif
+}
+
+void InitializeStage3DFieldTrial() {
+ if (!ShouldRunStage3DFieldTrial()) {
+ base::FieldTrial* trial =
+ base::FieldTrialList::Find(content::kStage3DFieldTrialName);
+ if (trial)
+ trial->Disable();
Alexei Svitkine (slow) 2012/09/19 20:33:16 Disabling the trial has the effect of choosing the
+ return;
+ }
+
+ const base::FieldTrial::Probability kDivisor = 1000;
+ scoped_refptr<base::FieldTrial> trial(
+ base::FieldTrialList::FactoryGetFieldTrial(
+ content::kStage3DFieldTrialName, kDivisor,
+ content::kStage3DFieldTrialBlacklistedName, 2013, 3, 1, NULL));
+
+ // Produce the same result on every run of this client.
+ trial->UseOneTimeRandomization();
+
+ // Kill-switch, so disabled unless we get info from server.
+ int enabled_group = trial->AppendGroup(
+ content::kStage3DFieldTrialEnabledName, 0);
+
+ bool enabled = (trial->group() == enabled_group);
+
+ UMA_HISTOGRAM_BOOLEAN("GPU.Stage3DFieldTrial", enabled);
+}
+
// Load GPU Blacklist, collect preliminary gpu info, and compute preliminary
// gpu feature flags.
void InitializeGpuDataManager(const CommandLine& command_line) {

Powered by Google App Engine
This is Rietveld 408576698