From 2f01e1a9005b6b58e7389df852dfa90c9a45c249 Mon Sep 17 00:00:00 2001 From: "zmo@google.com" Date: Wed, 20 Jul 2011 20:05:01 +0000 Subject: Disallow gpu access if preliminary gpu info collection fails. It's likely something seriously wrong with the graphics driver if preliminary gpu info collection fails. BUG=89358 TEST=bots green Review URL: http://codereview.chromium.org/7472002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93236 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/gpu/gpu_data_manager.cc | 5 ++++- content/browser/gpu/gpu_data_manager.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'content/browser/gpu') diff --git a/content/browser/gpu/gpu_data_manager.cc b/content/browser/gpu/gpu_data_manager.cc index dc70ade..e790794 100644 --- a/content/browser/gpu/gpu_data_manager.cc +++ b/content/browser/gpu/gpu_data_manager.cc @@ -47,7 +47,8 @@ GpuDataManager::GpuDataManager() DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); GPUInfo gpu_info; - gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info); + allows_gpu_access_ = + gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info); UpdateGpuInfo(gpu_info); #if defined(OS_MACOSX) @@ -142,6 +143,8 @@ GpuFeatureFlags GpuDataManager::GetGpuFeatureFlags() { } bool GpuDataManager::GpuAccessAllowed() { + if (!allows_gpu_access_) + return false; // We only need to block GPU process if more features are disallowed other // than those in the preliminary gpu feature flags because the latter work // through renderer commandline switches. diff --git a/content/browser/gpu/gpu_data_manager.h b/content/browser/gpu/gpu_data_manager.h index bc373ed..0243da5 100644 --- a/content/browser/gpu/gpu_data_manager.h +++ b/content/browser/gpu/gpu_data_manager.h @@ -99,9 +99,9 @@ class GpuDataManager { bool complete_gpu_info_already_requested_; - bool gpu_feature_flags_set_; GpuFeatureFlags gpu_feature_flags_; GpuFeatureFlags preliminary_gpu_feature_flags_; + bool allows_gpu_access_; GPUInfo gpu_info_; mutable base::Lock gpu_info_lock_; -- cgit v1.1