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 "chrome/browser/gpu/chrome_gpu_util.h" | 5 #include "chrome/browser/gpu/chrome_gpu_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 "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // Produce the same result on every run of this client. | 149 // Produce the same result on every run of this client. |
150 trial->UseOneTimeRandomization(); | 150 trial->UseOneTimeRandomization(); |
151 | 151 |
152 base::FieldTrial::Probability force_compositing_mode_probability = 0; | 152 base::FieldTrial::Probability force_compositing_mode_probability = 0; |
153 base::FieldTrial::Probability threaded_compositing_probability = 0; | 153 base::FieldTrial::Probability threaded_compositing_probability = 0; |
154 | 154 |
155 // Note: Threaded compositing mode isn't feature complete on mac or linux yet: | 155 // Note: Threaded compositing mode isn't feature complete on mac or linux yet: |
156 // http://crbug.com/133602 for mac | 156 // http://crbug.com/133602 for mac |
157 // http://crbug.com/140866 for linux | 157 // http://crbug.com/140866 for linux |
158 | 158 |
159 #if defined(OS_WIN) | 159 #if defined(OS_WIN) || defined(OS_MACOSX) |
160 // Enable threaded compositing on Windows. | 160 // Enable threaded compositing on Windows. |
161 threaded_compositing_probability = kDivisor; | 161 threaded_compositing_probability = kDivisor; |
162 #elif defined(OS_MACOSX) | |
163 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | |
164 if (channel == chrome::VersionInfo::CHANNEL_CANARY || | |
165 channel == chrome::VersionInfo::CHANNEL_DEV) { | |
166 // Enable force-compositing-mode on the Mac. | |
167 force_compositing_mode_probability = kDivisor; | |
168 } | |
169 #endif | 162 #endif |
170 | 163 |
171 int force_compositing_group = trial->AppendGroup( | 164 int force_compositing_group = trial->AppendGroup( |
172 content::kGpuCompositingFieldTrialForceCompositingEnabledName, | 165 content::kGpuCompositingFieldTrialForceCompositingEnabledName, |
173 force_compositing_mode_probability); | 166 force_compositing_mode_probability); |
174 int thread_group = trial->AppendGroup( | 167 int thread_group = trial->AppendGroup( |
175 content::kGpuCompositingFieldTrialThreadEnabledName, | 168 content::kGpuCompositingFieldTrialThreadEnabledName, |
176 threaded_compositing_probability); | 169 threaded_compositing_probability); |
177 | 170 |
178 bool force_compositing = (trial->group() == force_compositing_group); | 171 bool force_compositing = (trial->group() == force_compositing_group); |
179 bool thread = (trial->group() == thread_group); | 172 bool thread = (trial->group() == thread_group); |
180 UMA_HISTOGRAM_BOOLEAN("GPU.InForceCompositingModeFieldTrial", | 173 UMA_HISTOGRAM_BOOLEAN("GPU.InForceCompositingModeFieldTrial", |
181 force_compositing); | 174 force_compositing); |
182 UMA_HISTOGRAM_BOOLEAN("GPU.InCompositorThreadFieldTrial", thread); | 175 UMA_HISTOGRAM_BOOLEAN("GPU.InCompositorThreadFieldTrial", thread); |
183 } | 176 } |
184 | 177 |
185 } // namespace gpu_util; | 178 } // namespace gpu_util; |
186 | 179 |
OLD | NEW |