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

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

Issue 241793002: Fix machine_model behaviors in gpu blacklist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« 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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 return false; 1132 return false;
1133 if (perf_gaming_info_.get() != NULL && 1133 if (perf_gaming_info_.get() != NULL &&
1134 (gpu_info.performance_stats.gaming == 0.0 || 1134 (gpu_info.performance_stats.gaming == 0.0 ||
1135 !perf_gaming_info_->Contains(gpu_info.performance_stats.gaming))) 1135 !perf_gaming_info_->Contains(gpu_info.performance_stats.gaming)))
1136 return false; 1136 return false;
1137 if (perf_overall_info_.get() != NULL && 1137 if (perf_overall_info_.get() != NULL &&
1138 (gpu_info.performance_stats.overall == 0.0 || 1138 (gpu_info.performance_stats.overall == 0.0 ||
1139 !perf_overall_info_->Contains(gpu_info.performance_stats.overall))) 1139 !perf_overall_info_->Contains(gpu_info.performance_stats.overall)))
1140 return false; 1140 return false;
1141 if (machine_model_info_.get() != NULL) { 1141 if (machine_model_info_.get() != NULL) {
1142 #if defined(OS_MACOSX)
Ken Russell (switch to Gerrit) 2014/04/17 22:24:57 Making this code conditionally compiled is really
1142 std::vector<std::string> name_version; 1143 std::vector<std::string> name_version;
1143 base::SplitString(gpu_info.machine_model, ' ', &name_version); 1144 base::SplitString(gpu_info.machine_model, ' ', &name_version);
1144 if (name_version.size() == 2 && 1145 if (name_version.size() == 2 &&
1145 !machine_model_info_->Contains(name_version[0], name_version[1])) 1146 !machine_model_info_->Contains(name_version[0], name_version[1]))
1146 return false; 1147 return false;
1148 #else
1149 if (!machine_model_info_->Contains(gpu_info.machine_model, std::string()))
1150 return false;
1151 #endif
1147 } 1152 }
1148 if (gpu_count_info_.get() != NULL && 1153 if (gpu_count_info_.get() != NULL &&
1149 !gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1)) 1154 !gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1))
1150 return false; 1155 return false;
1151 if (direct_rendering_info_.get() != NULL && 1156 if (direct_rendering_info_.get() != NULL &&
1152 !direct_rendering_info_->Contains(gpu_info.direct_rendering)) 1157 !direct_rendering_info_->Contains(gpu_info.direct_rendering))
1153 return false; 1158 return false;
1154 if (cpu_brand_.get() != NULL) { 1159 if (cpu_brand_.get() != NULL) {
1155 base::CPU cpu_info; 1160 base::CPU cpu_info;
1156 if (!cpu_brand_->Contains(cpu_info.cpu_brand())) 1161 if (!cpu_brand_->Contains(cpu_info.cpu_brand()))
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 const std::string& feature_name, int feature_id) { 1444 const std::string& feature_name, int feature_id) {
1440 feature_map_[feature_name] = feature_id; 1445 feature_map_[feature_name] = feature_id;
1441 } 1446 }
1442 1447
1443 void GpuControlList::set_supports_feature_type_all(bool supported) { 1448 void GpuControlList::set_supports_feature_type_all(bool supported) {
1444 supports_feature_type_all_ = supported; 1449 supports_feature_type_all_ = supported;
1445 } 1450 }
1446 1451
1447 } // namespace gpu 1452 } // namespace gpu
1448 1453
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