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_impl.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 | 83 |
| 84 bool GpuDataManagerImpl::IsCompleteGPUInfoAvailable() const { | 84 bool GpuDataManagerImpl::IsCompleteGPUInfoAvailable() const { |
| 85 return complete_gpu_info_available_; | 85 return complete_gpu_info_available_; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void GpuDataManagerImpl::UpdateGpuInfo(const content::GPUInfo& gpu_info) { | 88 void GpuDataManagerImpl::UpdateGpuInfo(const content::GPUInfo& gpu_info) { |
| 89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 90 | 90 |
| 91 { | 91 { |
| 92 base::AutoLock auto_lock(gpu_info_lock_); | 92 base::AutoLock auto_lock(gpu_info_lock_); |
| 93 if (gpu_info.gpu.vendor_id && gpu_info.gpu.device_id) { | 93 if (gpu_info.gpu.vendor_id && gpu_info.gpu.device_id) |
|
robdclark
2012/05/16 20:35:21
why not handle the blacklist by GL_VENDER/GL_RENDE
| |
| 94 gpu_info_ = gpu_info; | 94 gpu_info_ = gpu_info; |
| 95 } else { | 95 else |
| 96 gpu_info_.gpu_accessible = false; | |
| 97 gpu_info_.finalized = true; | 96 gpu_info_.finalized = true; |
| 98 } | |
| 99 complete_gpu_info_available_ = | 97 complete_gpu_info_available_ = |
| 100 complete_gpu_info_available_ || gpu_info_.finalized; | 98 complete_gpu_info_available_ || gpu_info_.finalized; |
| 101 complete_gpu_info_already_requested_ = | 99 complete_gpu_info_already_requested_ = |
| 102 complete_gpu_info_already_requested_ || gpu_info_.finalized; | 100 complete_gpu_info_already_requested_ || gpu_info_.finalized; |
| 103 content::GetContentClient()->SetGpuInfo(gpu_info_); | 101 content::GetContentClient()->SetGpuInfo(gpu_info_); |
| 104 } | 102 } |
| 105 | 103 |
| 106 // We have to update GpuFeatureType before notify all the observers. | 104 // We have to update GpuFeatureType before notify all the observers. |
| 107 NotifyGpuInfoUpdate(); | 105 NotifyGpuInfoUpdate(); |
| 108 } | 106 } |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 int flags = gpu_feature_type_; | 284 int flags = gpu_feature_type_; |
| 287 flags |= content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING | | 285 flags |= content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING | |
| 288 content::GPU_FEATURE_TYPE_WEBGL; | 286 content::GPU_FEATURE_TYPE_WEBGL; |
| 289 gpu_feature_type_ = static_cast<GpuFeatureType>(flags); | 287 gpu_feature_type_ = static_cast<GpuFeatureType>(flags); |
| 290 } | 288 } |
| 291 | 289 |
| 292 EnableSoftwareRenderingIfNecessary(); | 290 EnableSoftwareRenderingIfNecessary(); |
| 293 NotifyGpuInfoUpdate(); | 291 NotifyGpuInfoUpdate(); |
| 294 } | 292 } |
| 295 | 293 |
| OLD | NEW |