OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/gpu/compositor_util.h" | 5 #include "content/browser/gpu/compositor_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "content/public/browser/gpu_data_manager.h" | 9 #include "content/public/browser/gpu_data_manager.h" |
10 #include "content/public/common/content_constants.h" | 10 #include "content/public/common/content_constants.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 base::FieldTrialList::Find(kGpuCompositingFieldTrialName); | 96 base::FieldTrialList::Find(kGpuCompositingFieldTrialName); |
97 | 97 |
98 // Force compositing is enabled in both the force compositing | 98 // Force compositing is enabled in both the force compositing |
99 // and threaded compositing mode field trials. | 99 // and threaded compositing mode field trials. |
100 return trial && | 100 return trial && |
101 (trial->group_name() == | 101 (trial->group_name() == |
102 kGpuCompositingFieldTrialForceCompositingEnabledName || | 102 kGpuCompositingFieldTrialForceCompositingEnabledName || |
103 trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName); | 103 trial->group_name() == kGpuCompositingFieldTrialThreadEnabledName); |
104 } | 104 } |
105 | 105 |
106 bool IsDelegatedRendererEnabled() { | |
107 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
108 bool enabled = false; | |
109 #if defined(USE_AURA) | |
danakj
2013/08/30 00:10:08
nit: space above this.
piman
2013/08/30 04:01:20
Done.
| |
110 // Default to true on Aura, but allow override via flags. | |
111 enabled = true; | |
112 #endif | |
113 | |
114 // Flags override. | |
115 enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer); | |
116 enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer); | |
117 | |
118 // Needs compositing, and thread. | |
119 enabled &= IsForceCompositingModeEnabled(); | |
danakj
2013/08/30 00:10:08
maybe LOG(ERROR) if one of these causes it to be d
piman
2013/08/30 04:01:20
Done.
| |
120 enabled &= IsThreadedCompositingEnabled(); | |
121 | |
122 return enabled; | |
123 } | |
124 | |
106 } // namespace content | 125 } // namespace content |
OLD | NEW |