Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 534043002: Add bits to indicate which parts of GPUInfo are collected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e1513693735cf800719d0a219731225a61bdacb4 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,20 @@ 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) {
+ return false;
+ }
+ return true;
+}
+
bool GpuDataManagerImplPrivate::IsCompleteGpuInfoAvailable() const {
- return gpu_info_.finalized;
+#if defined(OS_WIN)
+ if (gpu_info_.dx_diagnostics_info_state == gpu::kCollectInfoNone)
+ return false;
+#endif
+ return IsEssentialGpuInfoAvailable();
}
void GpuDataManagerImplPrivate::RequestVideoMemoryUsageStatsUpdate() const {
@@ -503,9 +515,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 +565,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 +1089,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();
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698