Chromium Code Reviews| 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/chrome_gpu_util.h" | 5 #include "chrome/browser/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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 // field trial. | 67 // field trial. |
| 68 if (!ShouldRunCompositingFieldTrial()) { | 68 if (!ShouldRunCompositingFieldTrial()) { |
| 69 DisableCompositingFieldTrial(); | 69 DisableCompositingFieldTrial(); |
| 70 return; | 70 return; |
| 71 } | 71 } |
| 72 | 72 |
| 73 const base::FieldTrial::Probability kDivisor = 3; | 73 const base::FieldTrial::Probability kDivisor = 3; |
| 74 scoped_refptr<base::FieldTrial> trial( | 74 scoped_refptr<base::FieldTrial> trial( |
| 75 base::FieldTrialList::FactoryGetFieldTrial( | 75 base::FieldTrialList::FactoryGetFieldTrial( |
| 76 content::kGpuCompositingFieldTrialName, kDivisor, | 76 content::kGpuCompositingFieldTrialName, kDivisor, |
| 77 "disable", 2012, 12, 31, NULL)); | 77 "disable", 2017, 12, 31, NULL)); |
| 78 | 78 |
| 79 // Produce the same result on every run of this client. | 79 // Produce the same result on every run of this client. |
| 80 trial->UseOneTimeRandomization(); | 80 trial->UseOneTimeRandomization(); |
| 81 | 81 |
| 82 base::FieldTrial::Probability force_compositing_mode_probability = 0; | 82 base::FieldTrial::Probability force_compositing_mode_probability = 0; |
| 83 base::FieldTrial::Probability threaded_compositing_probability = 0; | 83 base::FieldTrial::Probability threaded_compositing_probability = 0; |
| 84 | 84 |
| 85 // Threaded compositing mode isn't feature complete on mac or linux yet: | |
| 86 // http://crbug.com/133602 for mac | |
| 87 // http://crbug.com/140866 for linux | |
| 88 | |
| 89 #if defined(OS_WIN) | |
| 90 // threaded-compositing turned on by default on Windows. | |
| 91 // (Windows XP is excluded explicitly in ShouldRunCompositingFieldTrial) | |
| 92 threaded_compositing_probability = 3; | |
| 93 #elif defined(OS_MACOSX) | |
| 94 // force-compositing-mode turned on by default on mac. | |
| 95 force_compositing_mode_probability = 3; | |
| 96 #elif defined(OS_LINUX) | |
| 97 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | |
| 98 if (channel != chrome::VersionInfo::CHANNEL_STABLE && | |
| 99 channel != chrome::VersionInfo::CHANNEL_BETA) { | |
| 100 // On channels < beta, force-compositing-mode and | |
| 101 // threaded-compositing on with 1/3 probability each. | |
|
Nico
2012/09/13 01:37:21
This is gonna be hell for bug triage. What are the
| |
| 102 force_compositing_mode_probability = 1; | |
| 103 threaded_compositing_mode_probability = 1; | |
| 104 } | |
| 105 #endif | |
| 106 | |
| 85 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 107 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 86 if (channel == chrome::VersionInfo::CHANNEL_STABLE || | 108 if (channel == chrome::VersionInfo::CHANNEL_STABLE || |
| 87 channel == chrome::VersionInfo::CHANNEL_BETA) { | 109 channel == chrome::VersionInfo::CHANNEL_BETA) { |
| 88 // Stable and Beta channels: Non-threaded force-compositing-mode on by | 110 // Stable and Beta channels: Non-threaded force-compositing-mode on by |
| 89 // default (mac and windows only). | 111 // default (mac and windows only). |
| 90 #if defined(OS_WIN) || defined(OS_MACOSX) | 112 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 91 force_compositing_mode_probability = 3; | 113 force_compositing_mode_probability = 3; |
| 92 #endif | 114 #endif |
| 93 } else if (channel == chrome::VersionInfo::CHANNEL_DEV || | 115 } else if (channel == chrome::VersionInfo::CHANNEL_DEV || |
| 94 channel == chrome::VersionInfo::CHANNEL_CANARY) { | 116 channel == chrome::VersionInfo::CHANNEL_CANARY) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 ResourceBundle::GetSharedInstance().GetRawDataResource( | 161 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 140 IDR_GPU_BLACKLIST, ui::SCALE_FACTOR_NONE)); | 162 IDR_GPU_BLACKLIST, ui::SCALE_FACTOR_NONE)); |
| 141 gpu_blacklist_json_string = gpu_blacklist_json.as_string(); | 163 gpu_blacklist_json_string = gpu_blacklist_json.as_string(); |
| 142 } | 164 } |
| 143 content::GpuDataManager::GetInstance()->Initialize( | 165 content::GpuDataManager::GetInstance()->Initialize( |
| 144 chrome_version_string, gpu_blacklist_json_string); | 166 chrome_version_string, gpu_blacklist_json_string); |
| 145 } | 167 } |
| 146 | 168 |
| 147 } // namespace gpu_util; | 169 } // namespace gpu_util; |
| 148 | 170 |
| OLD | NEW |