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

Side by Side Diff: gpu/config/gpu_control_list.cc

Issue 253883006: Missing machine model info should be a no match for GPU blacklist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | gpu/config/gpu_control_list_entry_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/config/gpu_control_list.h" 5 #include "gpu/config/gpu_control_list.h"
6 6
7 #include "base/cpu.h" 7 #include "base/cpu.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 !perf_graphics_info_->Contains(gpu_info.performance_stats.graphics))) 1114 !perf_graphics_info_->Contains(gpu_info.performance_stats.graphics)))
1115 return false; 1115 return false;
1116 if (perf_gaming_info_.get() != NULL && 1116 if (perf_gaming_info_.get() != NULL &&
1117 (gpu_info.performance_stats.gaming == 0.0 || 1117 (gpu_info.performance_stats.gaming == 0.0 ||
1118 !perf_gaming_info_->Contains(gpu_info.performance_stats.gaming))) 1118 !perf_gaming_info_->Contains(gpu_info.performance_stats.gaming)))
1119 return false; 1119 return false;
1120 if (perf_overall_info_.get() != NULL && 1120 if (perf_overall_info_.get() != NULL &&
1121 (gpu_info.performance_stats.overall == 0.0 || 1121 (gpu_info.performance_stats.overall == 0.0 ||
1122 !perf_overall_info_->Contains(gpu_info.performance_stats.overall))) 1122 !perf_overall_info_->Contains(gpu_info.performance_stats.overall)))
1123 return false; 1123 return false;
1124 if (!machine_model_name_list_.empty() && 1124 if (!machine_model_name_list_.empty()) {
1125 !gpu_info.machine_model_name.empty()) { 1125 if (gpu_info.machine_model_name.empty())
1126 return false;
1126 bool found_match = false; 1127 bool found_match = false;
1127 for (size_t ii = 0; ii < machine_model_name_list_.size(); ++ii) { 1128 for (size_t ii = 0; ii < machine_model_name_list_.size(); ++ii) {
1128 if (machine_model_name_list_[ii] == gpu_info.machine_model_name) { 1129 if (machine_model_name_list_[ii] == gpu_info.machine_model_name) {
1129 found_match = true; 1130 found_match = true;
1130 break; 1131 break;
1131 } 1132 }
1132 } 1133 }
1133 if (!found_match) 1134 if (!found_match)
1134 return false; 1135 return false;
1135 } 1136 }
1136 if (machine_model_version_info_.get() != NULL && 1137 if (machine_model_version_info_.get() != NULL &&
1137 !gpu_info.machine_model_version.empty() && 1138 (gpu_info.machine_model_version.empty() ||
1138 !machine_model_version_info_->Contains(gpu_info.machine_model_version)) 1139 !machine_model_version_info_->Contains(gpu_info.machine_model_version)))
1139 return false; 1140 return false;
1140 if (gpu_count_info_.get() != NULL && 1141 if (gpu_count_info_.get() != NULL &&
1141 !gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1)) 1142 !gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1))
1142 return false; 1143 return false;
1143 if (direct_rendering_info_.get() != NULL && 1144 if (direct_rendering_info_.get() != NULL &&
1144 !direct_rendering_info_->Contains(gpu_info.direct_rendering)) 1145 !direct_rendering_info_->Contains(gpu_info.direct_rendering))
1145 return false; 1146 return false;
1146 if (cpu_brand_.get() != NULL) { 1147 if (cpu_brand_.get() != NULL) {
1147 base::CPU cpu_info; 1148 base::CPU cpu_info;
1148 if (!cpu_brand_->Contains(cpu_info.cpu_brand())) 1149 if (!cpu_brand_->Contains(cpu_info.cpu_brand()))
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 const std::string& feature_name, int feature_id) { 1432 const std::string& feature_name, int feature_id) {
1432 feature_map_[feature_name] = feature_id; 1433 feature_map_[feature_name] = feature_id;
1433 } 1434 }
1434 1435
1435 void GpuControlList::set_supports_feature_type_all(bool supported) { 1436 void GpuControlList::set_supports_feature_type_all(bool supported) {
1436 supports_feature_type_all_ = supported; 1437 supports_feature_type_all_ = supported;
1437 } 1438 }
1438 1439
1439 } // namespace gpu 1440 } // namespace gpu
1440 1441
OLDNEW
« no previous file with comments | « no previous file | gpu/config/gpu_control_list_entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698