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

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: fix browser_tests 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
« no previous file with comments | « chrome/browser/chrome_gpu_util.h ('k') | chrome/test/gpu/gpu_feature_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_gpu_util.cc
diff --git a/chrome/browser/chrome_gpu_util.cc b/chrome/browser/chrome_gpu_util.cc
index c3cd7f5430487d599bf622e06fda70fb6f788882..b4221eca6e88addc629eef7120cd5ce02686f87c 100644
--- a/chrome/browser/chrome_gpu_util.cc
+++ b/chrome/browser/chrome_gpu_util.cc
@@ -21,6 +21,43 @@ using content::GpuDataManager;
namespace gpu_util {
+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();
+ return;
+ }
+
+ const base::FieldTrial::Probability kDivisor = 1000;
+ scoped_refptr<base::FieldTrial> trial(
+ base::FieldTrialList::FactoryGetFieldTrial(
+ content::kStage3DFieldTrialName, kDivisor,
+ content::kStage3DFieldTrialEnabledName, 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 blacklisted_group = trial->AppendGroup(
+ content::kStage3DFieldTrialBlacklistedName, kDivisor);
+
+ bool enabled = (trial->group() != blacklisted_group);
+
+ UMA_HISTOGRAM_BOOLEAN("GPU.Stage3DFieldTrial", enabled);
+}
+
void DisableCompositingFieldTrial() {
base::FieldTrial* trial =
base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
« no previous file with comments | « chrome/browser/chrome_gpu_util.h ('k') | chrome/test/gpu/gpu_feature_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698