OLD | NEW |
(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 content { |
| 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 |
OLD | NEW |