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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 0, | 42 0, |
43 content::CAUSE_FOR_GPU_LAUNCH_GPUDATAMANAGER_REQUESTCOMPLETEGPUINFOIFNEEDE
D, | 43 content::CAUSE_FOR_GPU_LAUNCH_GPUDATAMANAGER_REQUESTCOMPLETEGPUINFOIFNEEDE
D, |
44 new GpuMsg_CollectGraphicsInfo()); | 44 new GpuMsg_CollectGraphicsInfo()); |
45 } | 45 } |
46 | 46 |
47 void GpuDataManager::UpdateGpuInfo(const GPUInfo& gpu_info) { | 47 void GpuDataManager::UpdateGpuInfo(const GPUInfo& gpu_info) { |
48 { | 48 { |
49 base::AutoLock auto_lock(gpu_info_lock_); | 49 base::AutoLock auto_lock(gpu_info_lock_); |
50 if (!gpu_info_.Merge(gpu_info)) | 50 if (!gpu_info_.Merge(gpu_info)) |
51 return; | 51 return; |
| 52 } |
52 | 53 |
53 RunGpuInfoUpdateCallbacks(); | 54 RunGpuInfoUpdateCallbacks(); |
| 55 |
| 56 { |
| 57 base::AutoLock auto_lock(gpu_info_lock_); |
54 content::GetContentClient()->SetGpuInfo(gpu_info_); | 58 content::GetContentClient()->SetGpuInfo(gpu_info_); |
55 } | 59 } |
56 | 60 |
57 UpdateGpuFeatureFlags(); | 61 UpdateGpuFeatureFlags(); |
58 } | 62 } |
59 | 63 |
60 const GPUInfo& GpuDataManager::gpu_info() const { | 64 const GPUInfo& GpuDataManager::gpu_info() const { |
61 base::AutoLock auto_lock(gpu_info_lock_); | 65 base::AutoLock auto_lock(gpu_info_lock_); |
62 return gpu_info_; | 66 return gpu_info_; |
63 } | 67 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 268 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
265 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || | 269 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || |
266 browser_command_line.GetSwitchValueASCII( | 270 browser_command_line.GetSwitchValueASCII( |
267 switches::kUseGL) == gfx::kGLImplementationOSMesaName) | 271 switches::kUseGL) == gfx::kGLImplementationOSMesaName) |
268 return NULL; | 272 return NULL; |
269 // No need to return an empty blacklist. | 273 // No need to return an empty blacklist. |
270 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) | 274 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) |
271 return NULL; | 275 return NULL; |
272 return gpu_blacklist_.get(); | 276 return gpu_blacklist_.get(); |
273 } | 277 } |
OLD | NEW |