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

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

Issue 10908110: Move gpu blacklist to content side. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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.h ('k') | content/browser/gpu/gpu_data_manager_impl_unittest.cc » ('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.cc
===================================================================
--- content/browser/gpu/gpu_data_manager_impl.cc (revision 155054)
+++ content/browser/gpu/gpu_data_manager_impl.cc (working copy)
@@ -13,6 +13,7 @@
#include "base/values.h"
#include "base/version.h"
#include "content/browser/gpu/gpu_process_host.h"
+#include "content/browser/gpu/gpu_util.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/gpu/gpu_info_collector.h"
#include "content/public/browser/browser_thread.h"
@@ -58,14 +59,24 @@
BlacklistCard();
}
-void GpuDataManagerImpl::InitializeGpuInfo() {
+void GpuDataManagerImpl::Initialize(
+ const std::string& browser_version_string,
+ const std::string& gpu_blacklist_json) {
content::GPUInfo gpu_info;
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSkipGpuDataLoading))
- gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info);
- else
- gpu_info.finalized = true;
+ gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info);
+
+ if (!gpu_blacklist_json.empty()) {
+ CHECK(!browser_version_string.empty());
+ gpu_blacklist_.reset(new GpuBlacklist());
+ bool succeed = gpu_blacklist_->LoadGpuBlacklist(
+ browser_version_string,
+ gpu_blacklist_json,
+ GpuBlacklist::kCurrentOsOnly);
+ CHECK(succeed);
+ }
+
UpdateGpuInfo(gpu_info);
+ UpdatePreliminaryBlacklistedFeatures();
}
GpuDataManagerImpl::~GpuDataManagerImpl() {
@@ -92,6 +103,15 @@
content::GetContentClient()->SetGpuInfo(gpu_info);
+ if (gpu_blacklist_.get()) {
+ GpuFeatureType feature_type = gpu_blacklist_->DetermineGpuFeatureType(
+ GpuBlacklist::kOsAny,
+ NULL,
+ GpuDataManager::GetInstance()->GetGPUInfo());
+ gpu_util::UpdateStats(gpu_blacklist_.get(), feature_type);
+ UpdateBlacklistedFeatures(feature_type);
+ }
+
{
base::AutoLock auto_lock(gpu_info_lock_);
gpu_info_ = gpu_info;
@@ -142,6 +162,12 @@
return value;
}
+std::string GpuDataManagerImpl::GetBlacklistVersion() const {
+ if (gpu_blacklist_.get())
+ return gpu_blacklist_->GetVersion();
+ return "0";
+}
+
GpuFeatureType GpuDataManagerImpl::GetBlacklistedFeatures() const {
if (software_rendering_) {
GpuFeatureType flags;
@@ -155,6 +181,13 @@
return gpu_feature_type_;
}
+base::ListValue* GpuDataManagerImpl::GetBlacklistReasons() const {
+ ListValue* reasons = new ListValue();
+ if (gpu_blacklist_.get())
+ gpu_blacklist_->GetBlacklistReasons(reasons);
+ return reasons;
+}
+
bool GpuDataManagerImpl::GpuAccessAllowed() const {
if (software_rendering_)
return true;
@@ -305,9 +338,7 @@
#endif
}
-void GpuDataManagerImpl::SetPreliminaryBlacklistedFeatures(
- GpuFeatureType feature_type) {
- UpdateBlacklistedFeatures(feature_type);
+void GpuDataManagerImpl::UpdatePreliminaryBlacklistedFeatures() {
preliminary_gpu_feature_type_ = gpu_feature_type_;
}
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl.h ('k') | content/browser/gpu/gpu_data_manager_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698