| 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_ = |
| 254 complete_gpu_info_already_requested_ = true; | 254 complete_gpu_info_available_ || gpu_info.finalized; |
| 255 complete_gpu_info_already_requested_ = |
| 256 complete_gpu_info_already_requested_ || gpu_info.finalized; |
| 255 { | 257 { |
| 256 base::AutoLock auto_lock(gpu_info_lock_); | 258 base::AutoLock auto_lock(gpu_info_lock_); |
| 257 if (!Merge(&gpu_info_, gpu_info)) | 259 if (!Merge(&gpu_info_, gpu_info)) |
| 258 return; | 260 return; |
| 259 content::GetContentClient()->SetGpuInfo(gpu_info_); | 261 content::GetContentClient()->SetGpuInfo(gpu_info_); |
| 260 } | 262 } |
| 261 | 263 |
| 262 UpdateGpuFeatureFlags(); | 264 UpdateGpuFeatureFlags(); |
| 263 // We have to update GpuFeatureFlags before notify all the observers. | 265 // We have to update GpuFeatureFlags before notify all the observers. |
| 264 NotifyGpuInfoUpdate(); | 266 NotifyGpuInfoUpdate(); |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 bool GpuDataManager::supportsAccelerated2dCanvas() const { | 761 bool GpuDataManager::supportsAccelerated2dCanvas() const { |
| 760 if (gpu_info_.can_lose_context) | 762 if (gpu_info_.can_lose_context) |
| 761 return false; | 763 return false; |
| 762 #if defined(USE_SKIA) | 764 #if defined(USE_SKIA) |
| 763 return true; | 765 return true; |
| 764 #else | 766 #else |
| 765 return false; | 767 return false; |
| 766 #endif | 768 #endif |
| 767 } | 769 } |
| 768 | 770 |
| OLD | NEW |