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 "content/browser/gpu/gpu_data_manager.h" | 5 #include "content/browser/gpu/gpu_data_manager.h" |
| 6 | 6 |
| 7 #if defined(OS_MACOSX) | 7 #if defined(OS_MACOSX) |
| 8 #include <CoreGraphics/CGDisplayConfiguration.h> | 8 #include <CoreGraphics/CGDisplayConfiguration.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 | 243 |
| 244 GpuProcessHost::SendOnIO( | 244 GpuProcessHost::SendOnIO( |
| 245 0, | 245 0, |
| 246 content::CAUSE_FOR_GPU_LAUNCH_GPUDATAMANAGER_REQUESTCOMPLETEGPUINFOIFNEEDE D, | 246 content::CAUSE_FOR_GPU_LAUNCH_GPUDATAMANAGER_REQUESTCOMPLETEGPUINFOIFNEEDE D, |
| 247 new GpuMsg_CollectGraphicsInfo()); | 247 new GpuMsg_CollectGraphicsInfo()); |
| 248 } | 248 } |
| 249 | 249 |
| 250 void GpuDataManager::UpdateGpuInfo(const content::GPUInfo& gpu_info) { | 250 void GpuDataManager::UpdateGpuInfo(const content::GPUInfo& gpu_info) { |
| 251 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 251 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 252 | 252 |
| 253 complete_gpu_info_available_ = true; | 253 complete_gpu_info_available_ = gpu_info.finalized; |
|
apatrick_chromium
2012/01/24 19:01:04
these are probably wrong. perhaps once they have b
Zhenyao Mo
2012/01/24 19:15:33
Yes, this should be
complete_gpu_info_available_
| |
| 254 complete_gpu_info_already_requested_ = true; | 254 complete_gpu_info_already_requested_ = gpu_info.finalized; |
| 255 { | 255 { |
| 256 base::AutoLock auto_lock(gpu_info_lock_); | 256 base::AutoLock auto_lock(gpu_info_lock_); |
| 257 if (!Merge(&gpu_info_, gpu_info)) | 257 if (!Merge(&gpu_info_, gpu_info)) |
| 258 return; | 258 return; |
| 259 content::GetContentClient()->SetGpuInfo(gpu_info_); | 259 content::GetContentClient()->SetGpuInfo(gpu_info_); |
| 260 } | 260 } |
| 261 | 261 |
| 262 UpdateGpuFeatureFlags(); | 262 UpdateGpuFeatureFlags(); |
| 263 // We have to update GpuFeatureFlags before notify all the observers. | 263 // We have to update GpuFeatureFlags before notify all the observers. |
| 264 NotifyGpuInfoUpdate(); | 264 NotifyGpuInfoUpdate(); |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 759 bool GpuDataManager::supportsAccelerated2dCanvas() const { | 759 bool GpuDataManager::supportsAccelerated2dCanvas() const { |
| 760 if (gpu_info_.can_lose_context) | 760 if (gpu_info_.can_lose_context) |
| 761 return false; | 761 return false; |
| 762 #if defined(USE_SKIA) | 762 #if defined(USE_SKIA) |
| 763 return true; | 763 return true; |
| 764 #else | 764 #else |
| 765 return false; | 765 return false; |
| 766 #endif | 766 #endif |
| 767 } | 767 } |
| 768 | 768 |
| OLD | NEW |