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

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

Issue 23534006: Enable GPU blacklist in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge up to r223354 -- think AcceleratedCompositingBlockedTest.AcceleratedCompositingBlocked is fix… Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/config/gpu_control_list.h ('k') | gpu/config/software_rendering_list_json.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"
11 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/stringprintf.h"
13 #include "base/sys_info.h" 14 #include "base/sys_info.h"
14 #include "gpu/config/gpu_info.h" 15 #include "gpu/config/gpu_info.h"
15 #include "gpu/config/gpu_util.h" 16 #include "gpu/config/gpu_util.h"
16 17
17 namespace gpu { 18 namespace gpu {
18 namespace { 19 namespace {
19 20
20 // Break a version string into segments. Return true if each segment is 21 // Break a version string into segments. Return true if each segment is
21 // a valid number. 22 // a valid number.
22 bool ProcessVersionString(const std::string& version_string, 23 bool ProcessVersionString(const std::string& version_string,
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 const std::string& category) { 1030 const std::string& category) {
1030 if (category == kMultiGpuCategoryStringPrimary) 1031 if (category == kMultiGpuCategoryStringPrimary)
1031 return kMultiGpuCategoryPrimary; 1032 return kMultiGpuCategoryPrimary;
1032 if (category == kMultiGpuCategoryStringSecondary) 1033 if (category == kMultiGpuCategoryStringSecondary)
1033 return kMultiGpuCategorySecondary; 1034 return kMultiGpuCategorySecondary;
1034 if (category == kMultiGpuCategoryStringAny) 1035 if (category == kMultiGpuCategoryStringAny)
1035 return kMultiGpuCategoryAny; 1036 return kMultiGpuCategoryAny;
1036 return kMultiGpuCategoryNone; 1037 return kMultiGpuCategoryNone;
1037 } 1038 }
1038 1039
1040 void GpuControlList::GpuControlListEntry::LogControlListMatch() const {
1041 static const char kControlListMatchMessage[] =
1042 "Control list match for rule #%u.";
1043 LOG(INFO) << base::StringPrintf(kControlListMatchMessage, id_);
1044 }
1045
1039 bool GpuControlList::GpuControlListEntry::Contains( 1046 bool GpuControlList::GpuControlListEntry::Contains(
1040 OsType os_type, const std::string& os_version, 1047 OsType os_type, const std::string& os_version,
1041 const GPUInfo& gpu_info) const { 1048 const GPUInfo& gpu_info) const {
1042 DCHECK(os_type != kOsAny); 1049 DCHECK(os_type != kOsAny);
1043 if (os_info_.get() != NULL && !os_info_->Contains(os_type, os_version)) 1050 if (os_info_.get() != NULL && !os_info_->Contains(os_type, os_version))
1044 return false; 1051 return false;
1045 bool is_not_primary_gpu = 1052 bool is_not_primary_gpu =
1046 GpuUnmatched(vendor_id_, device_id_list_, gpu_info.gpu); 1053 GpuUnmatched(vendor_id_, device_id_list_, gpu_info.gpu);
1047 bool is_not_secondary_gpu = true; 1054 bool is_not_secondary_gpu = true;
1048 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) { 1055 for (size_t i = 0; i < gpu_info.secondary_gpus.size(); ++i) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 *feature_id = iter->second; 1192 *feature_id = iter->second;
1186 return true; 1193 return true;
1187 } 1194 }
1188 return false; 1195 return false;
1189 } 1196 }
1190 1197
1191 GpuControlList::GpuControlList() 1198 GpuControlList::GpuControlList()
1192 : max_entry_id_(0), 1199 : max_entry_id_(0),
1193 contains_unknown_fields_(false), 1200 contains_unknown_fields_(false),
1194 needs_more_info_(false), 1201 needs_more_info_(false),
1195 supports_feature_type_all_(false) { 1202 supports_feature_type_all_(false),
1203 control_list_logging_enabled_(false) {
1196 } 1204 }
1197 1205
1198 GpuControlList::~GpuControlList() { 1206 GpuControlList::~GpuControlList() {
1199 Clear(); 1207 Clear();
1200 } 1208 }
1201 1209
1202 bool GpuControlList::LoadList( 1210 bool GpuControlList::LoadList(
1203 const std::string& json_context, GpuControlList::OsFilter os_filter) { 1211 const std::string& json_context, GpuControlList::OsFilter os_filter) {
1204 const std::string browser_version_string = "0"; 1212 const std::string browser_version_string = "0";
1205 return LoadList(browser_version_string, json_context, os_filter); 1213 return LoadList(browser_version_string, json_context, os_filter);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1302 if (pos != std::string::npos) 1310 if (pos != std::string::npos)
1303 os_version = os_version.substr(0, pos); 1311 os_version = os_version.substr(0, pos);
1304 } 1312 }
1305 std::vector<std::string> pieces; 1313 std::vector<std::string> pieces;
1306 if (!ProcessVersionString(os_version, '.', &pieces)) 1314 if (!ProcessVersionString(os_version, '.', &pieces))
1307 os_version = "0"; 1315 os_version = "0";
1308 1316
1309 for (size_t i = 0; i < entries_.size(); ++i) { 1317 for (size_t i = 0; i < entries_.size(); ++i) {
1310 if (entries_[i]->Contains(os, os_version, gpu_info)) { 1318 if (entries_[i]->Contains(os, os_version, gpu_info)) {
1311 if (!entries_[i]->disabled()) { 1319 if (!entries_[i]->disabled()) {
1320 if (control_list_logging_enabled_)
1321 entries_[i]->LogControlListMatch();
1312 MergeFeatureSets(&possible_features, entries_[i]->features()); 1322 MergeFeatureSets(&possible_features, entries_[i]->features());
1313 if (!entries_[i]->NeedsMoreInfo(gpu_info)) 1323 if (!entries_[i]->NeedsMoreInfo(gpu_info))
1314 MergeFeatureSets(&features, entries_[i]->features()); 1324 MergeFeatureSets(&features, entries_[i]->features());
1315 } 1325 }
1316 active_entries_.push_back(entries_[i]); 1326 active_entries_.push_back(entries_[i]);
1317 } 1327 }
1318 } 1328 }
1319 1329
1320 if (possible_features.size() > features.size()) 1330 if (possible_features.size() > features.size())
1321 needs_more_info_ = true; 1331 needs_more_info_ = true;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 const std::string& feature_name, int feature_id) { 1451 const std::string& feature_name, int feature_id) {
1442 feature_map_[feature_name] = feature_id; 1452 feature_map_[feature_name] = feature_id;
1443 } 1453 }
1444 1454
1445 void GpuControlList::set_supports_feature_type_all(bool supported) { 1455 void GpuControlList::set_supports_feature_type_all(bool supported) {
1446 supports_feature_type_all_ = supported; 1456 supports_feature_type_all_ = supported;
1447 } 1457 }
1448 1458
1449 } // namespace gpu 1459 } // namespace gpu
1450 1460
OLDNEW
« no previous file with comments | « gpu/config/gpu_control_list.h ('k') | gpu/config/software_rendering_list_json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698