| 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 // Enable force compositing mode on Mac. | |
| 164 force_compositing_mode_probability = kDivisor; | |
| 165 #endif | 162 #endif |
| 166 | 163 |
| 167 int force_compositing_group = trial->AppendGroup( | 164 int force_compositing_group = trial->AppendGroup( |
| 168 content::kGpuCompositingFieldTrialForceCompositingEnabledName, | 165 content::kGpuCompositingFieldTrialForceCompositingEnabledName, |
| 169 force_compositing_mode_probability); | 166 force_compositing_mode_probability); |
| 170 int thread_group = trial->AppendGroup( | 167 int thread_group = trial->AppendGroup( |
| 171 content::kGpuCompositingFieldTrialThreadEnabledName, | 168 content::kGpuCompositingFieldTrialThreadEnabledName, |
| 172 threaded_compositing_probability); | 169 threaded_compositing_probability); |
| 173 | 170 |
| 174 bool force_compositing = (trial->group() == force_compositing_group); | 171 bool force_compositing = (trial->group() == force_compositing_group); |
| 175 bool thread = (trial->group() == thread_group); | 172 bool thread = (trial->group() == thread_group); |
| 176 UMA_HISTOGRAM_BOOLEAN("GPU.InForceCompositingModeFieldTrial", | 173 UMA_HISTOGRAM_BOOLEAN("GPU.InForceCompositingModeFieldTrial", |
| 177 force_compositing); | 174 force_compositing); |
| 178 UMA_HISTOGRAM_BOOLEAN("GPU.InCompositorThreadFieldTrial", thread); | 175 UMA_HISTOGRAM_BOOLEAN("GPU.InCompositorThreadFieldTrial", thread); |
| 179 } | 176 } |
| 180 | 177 |
| 181 } // namespace gpu_util; | 178 } // namespace gpu_util; |
| 182 | 179 |
| OLD | NEW |