Chromium Code Reviews| Index: content/browser/gpu/gpu_blacklist.cc |
| =================================================================== |
| --- content/browser/gpu/gpu_blacklist.cc (revision 101450) |
| +++ content/browser/gpu/gpu_blacklist.cc (working copy) |
| @@ -223,6 +223,12 @@ |
| return NULL; |
| } |
| dictionary_entry_count++; |
| + |
| + bool disabled; |
| + if (value->GetBoolean("disabled", &disabled)) { |
| + entry->SetDisabled(disabled); |
| + dictionary_entry_count++; |
| + } |
| } |
| std::string description; |
| @@ -456,6 +462,7 @@ |
| GpuBlacklist::GpuBlacklistEntry::GpuBlacklistEntry() |
| : id_(0), |
| + disabled_(false), |
| vendor_id_(0), |
| contains_unknown_fields_(false), |
| contains_unknown_features_(false) { |
| @@ -469,6 +476,10 @@ |
| return false; |
| } |
| +void GpuBlacklist::GpuBlacklistEntry::SetDisabled(bool disabled) { |
| + disabled_ = disabled; |
| +} |
| + |
| bool GpuBlacklist::GpuBlacklistEntry::SetOsInfo( |
| const std::string& os, |
| const std::string& version_op, |
| @@ -644,6 +655,10 @@ |
| return id_; |
| } |
| +bool GpuBlacklist::GpuBlacklistEntry::disabled() const { |
| + return disabled_; |
| +} |
| + |
| GpuFeatureFlags GpuBlacklist::GpuBlacklistEntry::GetGpuFeatureFlags() const { |
| return *feature_flags_; |
| } |
| @@ -752,8 +767,12 @@ |
| for (size_t i = 0; i < blacklist_.size(); ++i) { |
| if (blacklist_[i]->Contains(os, *os_version, browser_channel_, gpu_info)) { |
| - flags.Combine(blacklist_[i]->GetGpuFeatureFlags()); |
| - active_entries_.push_back(blacklist_[i]); |
| + if (blacklist_[i]->disabled()) { |
| + active_disabled_entries_.push_back(blacklist_[i]); |
|
vangelis
2011/09/21 21:27:17
nit: active_disabled_ is somewhat contradicting.
Zhenyao Mo
2011/09/22 17:10:39
removed active_disabled_emtries_
|
| + } else { |
| + flags.Combine(blacklist_[i]->GetGpuFeatureFlags()); |
|
vangelis
2011/09/21 21:27:17
Wouldn't it be simpler to add a disabled_ field in
Zhenyao Mo
2011/09/22 17:10:39
Done.
|
| + active_entries_.push_back(blacklist_[i]); |
| + } |
| } |
| } |
| return flags; |
| @@ -769,6 +788,17 @@ |
| } |
| } |
| +void GpuBlacklist::GetGpuFeatureFlagDisabledEntries( |
|
vangelis
2011/09/21 21:27:17
Instead of replicating the code here, this functio
Zhenyao Mo
2011/09/22 17:10:39
Done. I used a consolidated array to store the en
|
| + GpuFeatureFlags::GpuFeatureType feature, |
| + std::vector<uint32>& entry_ids) const { |
| + entry_ids.clear(); |
| + for (size_t i = 0; i < active_disabled_entries_.size(); ++i) { |
| + if ((feature & |
| + active_disabled_entries_[i]->GetGpuFeatureFlags().flags()) != 0) |
| + entry_ids.push_back(active_disabled_entries_[i]->id()); |
| + } |
| +} |
| + |
| bool GpuBlacklist::IsFeatureBlacklisted( |
| GpuFeatureFlags::GpuFeatureType feature) const |
| { |