Chromium Code Reviews| Index: content/browser/gpu/gpu_data_manager_impl_private.cc |
| diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc |
| index fd705c8967ac20837a5d2c6b45f039d7c71b3fa2..8278a9b45c65f11fdd09666cc22e121677cfeec7 100644 |
| --- a/content/browser/gpu/gpu_data_manager_impl_private.cc |
| +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc |
| @@ -226,7 +226,7 @@ void DisplayReconfigCallback(CGDirectDisplayID display, |
| bool gpu_changed = false; |
| if (flags & kCGDisplayAddFlag) { |
| uint32 vendor_id, device_id; |
| - if (gpu::CollectGpuID(&vendor_id, &device_id) == gpu::kGpuIDSuccess) { |
| + if (gpu::CollectGpuID(&vendor_id, &device_id) == gpu::kCollectInfoSuccess) { |
| gpu_changed = manager->UpdateActiveGpu(vendor_id, device_id); |
| } |
| } |
| @@ -363,7 +363,7 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed( |
| } |
| void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() { |
| - if (complete_gpu_info_already_requested_ || gpu_info_.finalized) |
| + if (complete_gpu_info_already_requested_ || IsCompleteGpuInfoAvailable()) |
| return; |
| complete_gpu_info_already_requested_ = true; |
| @@ -377,8 +377,21 @@ void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() { |
| new GpuMsg_CollectGraphicsInfo()); |
| } |
| +bool GpuDataManagerImplPrivate::IsEssentialGpuInfoAvailable() const { |
| + if (gpu_info_.basic_info_state == gpu::kCollectInfoNone || |
| + gpu_info_.context_info_state == gpu::kCollectInfoNone) |
|
Evan Stade
2014/09/03 21:47:58
nit: curlies
Zhenyao Mo
2014/09/03 21:56:10
Done.
|
| + return false; |
| + return true; |
| +} |
| + |
| bool GpuDataManagerImplPrivate::IsCompleteGpuInfoAvailable() const { |
|
Evan Stade
2014/09/03 21:47:58
{
#if defined(OS_WIN)
...
#endif
return IsEsse
Zhenyao Mo
2014/09/03 21:56:10
Done.
|
| - return gpu_info_.finalized; |
| + if (!IsEssentialGpuInfoAvailable()) |
| + return false; |
| +#if defined(OS_WIN) |
| + if (gpu_info_.dx_diagnostics_info_state == gpu::kCollectInfoNone) |
| + return false; |
| +#endif |
| + return true; |
| } |
| void GpuDataManagerImplPrivate::RequestVideoMemoryUsageStatsUpdate() const { |
| @@ -503,9 +516,13 @@ void GpuDataManagerImplPrivate::Initialize() { |
| gpu::CollectBasicGraphicsInfo(&gpu_info); |
| } |
| #if defined(ARCH_CPU_X86_FAMILY) |
| - if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) |
| - gpu_info.finalized = true; |
| -#endif |
| + if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) { |
| + gpu_info.context_info_state = gpu::kCollectInfoNonFatalFailure; |
| +#if defined(OS_WIN) |
| + gpu_info.dx_diagnostics_info_state = gpu::kCollectInfoNonFatalFailure; |
| +#endif // OS_WIN |
| + } |
| +#endif // ARCH_CPU_X86_FAMILY |
| std::string gpu_blacklist_string; |
| std::string gpu_driver_bug_list_string; |
| @@ -549,8 +566,8 @@ void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { |
| return; |
| gpu::MergeGPUInfo(&gpu_info_, gpu_info); |
| - complete_gpu_info_already_requested_ = |
| - complete_gpu_info_already_requested_ || gpu_info_.finalized; |
| + if (IsCompleteGpuInfoAvailable()) |
| + complete_gpu_info_already_requested_ = true; |
| UpdateGpuInfoHelper(); |
| } |
| @@ -1073,7 +1090,10 @@ void GpuDataManagerImplPrivate::Notify3DAPIBlocked(const GURL& url, |
| void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
| gpu_process_accessible_ = false; |
| - gpu_info_.finalized = true; |
| + gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| +#if defined(OS_WIN) |
| + gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| +#endif |
| complete_gpu_info_already_requested_ = true; |
| // Some observers might be waiting. |
| NotifyGpuInfoUpdate(); |