| 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 #if defined(OS_MACOSX) | 8 #if defined(OS_MACOSX) |
| 9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
| 10 #endif | 10 #endif |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // Produce the same result on every run of this client. | 105 // Produce the same result on every run of this client. |
| 106 trial->UseOneTimeRandomization(); | 106 trial->UseOneTimeRandomization(); |
| 107 | 107 |
| 108 base::FieldTrial::Probability force_compositing_mode_probability = 0; | 108 base::FieldTrial::Probability force_compositing_mode_probability = 0; |
| 109 base::FieldTrial::Probability threaded_compositing_probability = 0; | 109 base::FieldTrial::Probability threaded_compositing_probability = 0; |
| 110 | 110 |
| 111 // Note: Threaded compositing mode isn't feature complete on mac or linux yet: | 111 // Note: Threaded compositing mode isn't feature complete on mac or linux yet: |
| 112 // http://crbug.com/133602 for mac | 112 // http://crbug.com/133602 for mac |
| 113 // http://crbug.com/140866 for linux | 113 // http://crbug.com/140866 for linux |
| 114 | 114 |
| 115 #if defined(OS_WIN) || defined(OS_MACOSX) | 115 #if defined(OS_WIN) |
| 116 // Enable threaded compositing on Windows and Mac. | 116 // Enable threaded compositing on Windows. |
| 117 threaded_compositing_probability = kDivisor; | 117 threaded_compositing_probability = kDivisor; |
| 118 #elif defined(OS_MACOSX) |
| 119 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 120 if (channel == chrome::VersionInfo::CHANNEL_CANARY || |
| 121 channel == chrome::VersionInfo::CHANNEL_DEV) { |
| 122 // Enable force-compositing-mode on the Mac. |
| 123 force_compositing_mode_probability = kDivisor; |
| 124 } |
| 118 #endif | 125 #endif |
| 119 | 126 |
| 120 int force_compositing_group = trial->AppendGroup( | 127 int force_compositing_group = trial->AppendGroup( |
| 121 content::kGpuCompositingFieldTrialForceCompositingEnabledName, | 128 content::kGpuCompositingFieldTrialForceCompositingEnabledName, |
| 122 force_compositing_mode_probability); | 129 force_compositing_mode_probability); |
| 123 int thread_group = trial->AppendGroup( | 130 int thread_group = trial->AppendGroup( |
| 124 content::kGpuCompositingFieldTrialThreadEnabledName, | 131 content::kGpuCompositingFieldTrialThreadEnabledName, |
| 125 threaded_compositing_probability); | 132 threaded_compositing_probability); |
| 126 | 133 |
| 127 bool force_compositing = (trial->group() == force_compositing_group); | 134 bool force_compositing = (trial->group() == force_compositing_group); |
| 128 bool thread = (trial->group() == thread_group); | 135 bool thread = (trial->group() == thread_group); |
| 129 UMA_HISTOGRAM_BOOLEAN("GPU.InForceCompositingModeFieldTrial", | 136 UMA_HISTOGRAM_BOOLEAN("GPU.InForceCompositingModeFieldTrial", |
| 130 force_compositing); | 137 force_compositing); |
| 131 UMA_HISTOGRAM_BOOLEAN("GPU.InCompositorThreadFieldTrial", thread); | 138 UMA_HISTOGRAM_BOOLEAN("GPU.InCompositorThreadFieldTrial", thread); |
| 132 } | 139 } |
| 133 | 140 |
| 134 } // namespace gpu_util; | 141 } // namespace gpu_util; |
| 135 | 142 |
| OLD | NEW |