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

Side by Side Diff: content/public/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: revert some.gyp 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/public/common/compositor_util.h"
6
7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h"
9 #include "content/public/common/content_constants.h"
10 #include "content/public/common/content_switches.h"
11
12 namespace compositor_util {
13
14 bool IsThreadedCompositingEnabled() {
15 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
16 if (command_line.HasSwitch(switches::kEnableThreadedCompositing) &&
17 !command_line.HasSwitch(switches::kDisableThreadedCompositing))
18 return true;
19
20 base::FieldTrial* trial =
21 base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
22 return trial &&
23 trial->group_name() ==
24 content::kGpuCompositingFieldTrialThreadEnabledName;
25 }
26
27 bool IsForceCompositingModeEnabled() {
28 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
29 if (command_line.HasSwitch(switches::kForceCompositingMode) &&
30 !command_line.HasSwitch(switches::kDisableForceCompositingMode))
31 return true;
32
33 base::FieldTrial* trial =
34 base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
35
36 // Force compositing is enabled in both the force compositing
37 // and threaded compositing mode field trials.
38 return trial &&
39 (trial->group_name() ==
40 content::kGpuCompositingFieldTrialForceCompositingEnabledName ||
41 trial->group_name() ==
42 content::kGpuCompositingFieldTrialThreadEnabledName);
43 }
44
45 } // compositor_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698