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

Unified Diff: gpu/config/gpu_control_list.cc

Issue 194303002: Blacklist GLX indirect rendering (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android Created 6 years, 9 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 | « gpu/config/gpu_control_list.h ('k') | gpu/config/gpu_control_list_format.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_control_list.cc
diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc
index f051ea19382a75fcb3f84ce6172e9a4faf90f371..2465007fbd5339a7cebae7504b7f0ba0d8f349c7 100644
--- a/gpu/config/gpu_control_list.cc
+++ b/gpu/config/gpu_control_list.cc
@@ -414,6 +414,12 @@ bool GpuControlList::IntInfo::IsValid() const {
return op_ != kUnknown;
}
+GpuControlList::BoolInfo::BoolInfo(bool value) : value_(value) {}
+
+bool GpuControlList::BoolInfo::Contains(bool value) const {
+ return value_ == value;
+}
+
// static
GpuControlList::ScopedGpuControlListEntry
GpuControlList::GpuControlListEntry::GetEntryFromValue(
@@ -744,6 +750,12 @@ GpuControlList::GpuControlListEntry::GetEntryFromValue(
dictionary_entry_count++;
}
+ bool direct_rendering;
+ if (value->GetBoolean("direct_rendering", &direct_rendering)) {
+ entry->SetDirectRenderingInfo(direct_rendering);
+ dictionary_entry_count++;
+ }
+
if (top_level) {
const base::ListValue* feature_value = NULL;
if (value->GetList("features", &feature_value)) {
@@ -970,6 +982,10 @@ bool GpuControlList::GpuControlListEntry::SetGpuCountInfo(
return gpu_count_info_->IsValid();
}
+void GpuControlList::GpuControlListEntry::SetDirectRenderingInfo(bool value) {
+ direct_rendering_info_.reset(new BoolInfo(value));
+}
+
bool GpuControlList::GpuControlListEntry::SetFeatures(
const std::vector<std::string>& feature_strings,
const FeatureMap& feature_map,
@@ -1119,6 +1135,9 @@ bool GpuControlList::GpuControlListEntry::Contains(
if (gpu_count_info_.get() != NULL &&
!gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1))
return false;
+ if (direct_rendering_info_.get() != NULL &&
+ !direct_rendering_info_->Contains(gpu_info.direct_rendering))
+ return false;
if (cpu_brand_.get() != NULL) {
base::CPU cpu_info;
if (!cpu_brand_->Contains(cpu_info.cpu_brand()))
« no previous file with comments | « gpu/config/gpu_control_list.h ('k') | gpu/config/gpu_control_list_format.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698