OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gpu_data_manager.h" | 5 #include "content/browser/gpu/gpu_data_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 if (gpu_blacklist == NULL) | 178 if (gpu_blacklist == NULL) |
179 return; | 179 return; |
180 | 180 |
181 // We don't set a lock around modifying gpu_feature_flags_ since it's just an | 181 // We don't set a lock around modifying gpu_feature_flags_ since it's just an |
182 // int. | 182 // int. |
183 if (!gpu_blacklist) { | 183 if (!gpu_blacklist) { |
184 gpu_feature_flags_.set_flags(0); | 184 gpu_feature_flags_.set_flags(0); |
185 return; | 185 return; |
186 } | 186 } |
187 | 187 |
| 188 { |
| 189 base::AutoLock auto_lock(gpu_info_lock_); |
| 190 gpu_feature_flags_ = gpu_blacklist->DetermineGpuFeatureFlags( |
| 191 GpuBlacklist::kOsAny, NULL, gpu_info_); |
| 192 } |
| 193 |
188 uint32 max_entry_id = gpu_blacklist->max_entry_id(); | 194 uint32 max_entry_id = gpu_blacklist->max_entry_id(); |
189 if (!gpu_feature_flags_.flags()) { | 195 if (!gpu_feature_flags_.flags()) { |
190 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerEntry", | 196 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerEntry", |
191 0, max_entry_id + 1); | 197 0, max_entry_id + 1); |
192 return; | 198 return; |
193 } | 199 } |
194 | 200 |
195 // Notify clients that GpuInfo state has changed | 201 // Notify clients that GpuInfo state has changed |
196 RunGpuInfoUpdateCallbacks(); | 202 RunGpuInfoUpdateCallbacks(); |
197 | 203 |
(...skipping 13 matching lines...) Expand all Loading... |
211 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 217 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
212 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || | 218 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || |
213 browser_command_line.GetSwitchValueASCII( | 219 browser_command_line.GetSwitchValueASCII( |
214 switches::kUseGL) == gfx::kGLImplementationOSMesaName) | 220 switches::kUseGL) == gfx::kGLImplementationOSMesaName) |
215 return NULL; | 221 return NULL; |
216 // No need to return an empty blacklist. | 222 // No need to return an empty blacklist. |
217 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) | 223 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) |
218 return NULL; | 224 return NULL; |
219 return gpu_blacklist_.get(); | 225 return gpu_blacklist_.get(); |
220 } | 226 } |
OLD | NEW |