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

Unified Diff: content/common/compositor_util.cc

Issue 10824168: Cleaning up compositing field trial code and enable FCM in beta/stable (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: compositor_utils.cc moved to content\common Created 8 years, 4 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: content/common/compositor_util.cc
diff --git a/content/common/compositor_util.cc b/content/common/compositor_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ee14c052d9a8219ba67966288888b65e97259b00
--- /dev/null
+++ b/content/common/compositor_util.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 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/public/common/compositor_util.h"
+
+#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
+#include "content/public/common/content_constants.h"
+#include "content/public/common/content_switches.h"
+
+namespace content {
+
+bool IsThreadedCompositingEnabled() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kEnableThreadedCompositing) &&
+ !command_line.HasSwitch(switches::kDisableThreadedCompositing))
+ return true;
+
+ base::FieldTrial* trial =
+ base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
+ return trial &&
+ trial->group_name() ==
+ content::kGpuCompositingFieldTrialThreadEnabledName;
+}
+
+bool IsForceCompositingModeEnabled() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kForceCompositingMode) &&
+ !command_line.HasSwitch(switches::kDisableForceCompositingMode))
+ return true;
+
+ base::FieldTrial* trial =
+ base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
+
+ // Force compositing is enabled in both the force compositing
+ // and threaded compositing mode field trials.
+ return trial &&
+ (trial->group_name() ==
+ content::kGpuCompositingFieldTrialForceCompositingEnabledName ||
+ trial->group_name() ==
+ content::kGpuCompositingFieldTrialThreadEnabledName);
+}
+
+} // compositor_util

Powered by Google App Engine
This is Rietveld 408576698