| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 gl_version_value->GetString("value", &version_string); | 573 gl_version_value->GetString("value", &version_string); |
| 574 gl_version_value->GetString("value2", &version_string2); | 574 gl_version_value->GetString("value2", &version_string2); |
| 575 if (!entry->SetGLVersionInfo( | 575 if (!entry->SetGLVersionInfo( |
| 576 version_op, version_string, version_string2)) { | 576 version_op, version_string, version_string2)) { |
| 577 LOG(WARNING) << "Malformed gl_version entry " << entry->id(); | 577 LOG(WARNING) << "Malformed gl_version entry " << entry->id(); |
| 578 return NULL; | 578 return NULL; |
| 579 } | 579 } |
| 580 dictionary_entry_count++; | 580 dictionary_entry_count++; |
| 581 } | 581 } |
| 582 | 582 |
| 583 std::string gl_version_string_value; |
| 584 if (value->GetString("gl_version_string", &gl_version_string_value)) { |
| 585 if (!entry->SetGLVersionStringInfo(gl_version_string_value)) { |
| 586 LOG(WARNING) << "Malformed gl_version_string entry " << entry->id(); |
| 587 return NULL; |
| 588 } |
| 589 dictionary_entry_count++; |
| 590 } |
| 591 |
| 583 std::string gl_vendor_value; | 592 std::string gl_vendor_value; |
| 584 if (value->GetString("gl_vendor", &gl_vendor_value)) { | 593 if (value->GetString("gl_vendor", &gl_vendor_value)) { |
| 585 if (!entry->SetGLVendorInfo(gl_vendor_value)) { | 594 if (!entry->SetGLVendorInfo(gl_vendor_value)) { |
| 586 LOG(WARNING) << "Malformed gl_vendor entry " << entry->id(); | 595 LOG(WARNING) << "Malformed gl_vendor entry " << entry->id(); |
| 587 return NULL; | 596 return NULL; |
| 588 } | 597 } |
| 589 dictionary_entry_count++; | 598 dictionary_entry_count++; |
| 590 } | 599 } |
| 591 | 600 |
| 592 std::string gl_renderer_value; | 601 std::string gl_renderer_value; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 | 932 |
| 924 bool GpuControlList::GpuControlListEntry::SetGLVersionInfo( | 933 bool GpuControlList::GpuControlListEntry::SetGLVersionInfo( |
| 925 const std::string& version_op, | 934 const std::string& version_op, |
| 926 const std::string& version_string, | 935 const std::string& version_string, |
| 927 const std::string& version_string2) { | 936 const std::string& version_string2) { |
| 928 gl_version_info_.reset(new VersionInfo( | 937 gl_version_info_.reset(new VersionInfo( |
| 929 version_op, std::string(), version_string, version_string2)); | 938 version_op, std::string(), version_string, version_string2)); |
| 930 return gl_version_info_->IsValid(); | 939 return gl_version_info_->IsValid(); |
| 931 } | 940 } |
| 932 | 941 |
| 942 bool GpuControlList::GpuControlListEntry::SetGLVersionStringInfo( |
| 943 const std::string& version_string_value) { |
| 944 gl_version_string_info_ = version_string_value; |
| 945 return !gl_version_string_info_.empty(); |
| 946 } |
| 947 |
| 933 bool GpuControlList::GpuControlListEntry::SetGLVendorInfo( | 948 bool GpuControlList::GpuControlListEntry::SetGLVendorInfo( |
| 934 const std::string& vendor_value) { | 949 const std::string& vendor_value) { |
| 935 gl_vendor_info_ = vendor_value; | 950 gl_vendor_info_ = vendor_value; |
| 936 return !gl_vendor_info_.empty(); | 951 return !gl_vendor_info_.empty(); |
| 937 } | 952 } |
| 938 | 953 |
| 939 bool GpuControlList::GpuControlListEntry::SetGLRendererInfo( | 954 bool GpuControlList::GpuControlListEntry::SetGLRendererInfo( |
| 940 const std::string& renderer_value) { | 955 const std::string& renderer_value) { |
| 941 gl_renderer_info_ = renderer_value; | 956 gl_renderer_info_ = renderer_value; |
| 942 return !gl_renderer_info_.empty(); | 957 return !gl_renderer_info_.empty(); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 if (driver_version_info_.get() != NULL && !gpu_info.driver_version.empty()) { | 1265 if (driver_version_info_.get() != NULL && !gpu_info.driver_version.empty()) { |
| 1251 if (!driver_version_info_->Contains(gpu_info.driver_version)) | 1266 if (!driver_version_info_->Contains(gpu_info.driver_version)) |
| 1252 return false; | 1267 return false; |
| 1253 } | 1268 } |
| 1254 if (driver_date_info_.get() != NULL && !gpu_info.driver_date.empty()) { | 1269 if (driver_date_info_.get() != NULL && !gpu_info.driver_date.empty()) { |
| 1255 if (!driver_date_info_->Contains(gpu_info.driver_date, '-')) | 1270 if (!driver_date_info_->Contains(gpu_info.driver_date, '-')) |
| 1256 return false; | 1271 return false; |
| 1257 } | 1272 } |
| 1258 if (GLVersionInfoMismatch(gpu_info.gl_version)) | 1273 if (GLVersionInfoMismatch(gpu_info.gl_version)) |
| 1259 return false; | 1274 return false; |
| 1275 if (StringMismatch(gpu_info.gl_version, gl_version_string_info_)) |
| 1276 return false; |
| 1260 if (StringMismatch(gpu_info.gl_vendor, gl_vendor_info_)) | 1277 if (StringMismatch(gpu_info.gl_vendor, gl_vendor_info_)) |
| 1261 return false; | 1278 return false; |
| 1262 if (StringMismatch(gpu_info.gl_renderer, gl_renderer_info_)) | 1279 if (StringMismatch(gpu_info.gl_renderer, gl_renderer_info_)) |
| 1263 return false; | 1280 return false; |
| 1264 if (StringMismatch(gpu_info.gl_extensions, gl_extensions_info_)) | 1281 if (StringMismatch(gpu_info.gl_extensions, gl_extensions_info_)) |
| 1265 return false; | 1282 return false; |
| 1266 if (gl_reset_notification_strategy_info_.get() != NULL && | 1283 if (gl_reset_notification_strategy_info_.get() != NULL && |
| 1267 !gl_reset_notification_strategy_info_->Contains( | 1284 !gl_reset_notification_strategy_info_->Contains( |
| 1268 gpu_info.gl_reset_notification_strategy)) | 1285 gpu_info.gl_reset_notification_strategy)) |
| 1269 return false; | 1286 return false; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 const GPUInfo& gpu_info, | 1329 const GPUInfo& gpu_info, |
| 1313 bool consider_exceptions) const { | 1330 bool consider_exceptions) const { |
| 1314 // We only check for missing info that might be collected with a gl context. | 1331 // We only check for missing info that might be collected with a gl context. |
| 1315 // If certain info is missing due to some error, say, we fail to collect | 1332 // If certain info is missing due to some error, say, we fail to collect |
| 1316 // vendor_id/device_id, then even if we launch GPU process and create a gl | 1333 // vendor_id/device_id, then even if we launch GPU process and create a gl |
| 1317 // context, we won't gather such missing info, so we still return false. | 1334 // context, we won't gather such missing info, so we still return false. |
| 1318 if (!driver_vendor_info_.empty() && gpu_info.driver_vendor.empty()) | 1335 if (!driver_vendor_info_.empty() && gpu_info.driver_vendor.empty()) |
| 1319 return true; | 1336 return true; |
| 1320 if (driver_version_info_.get() && gpu_info.driver_version.empty()) | 1337 if (driver_version_info_.get() && gpu_info.driver_version.empty()) |
| 1321 return true; | 1338 return true; |
| 1339 if (!gl_version_string_info_.empty() && gpu_info.gl_version.empty()) |
| 1340 return true; |
| 1322 if (!gl_vendor_info_.empty() && gpu_info.gl_vendor.empty()) | 1341 if (!gl_vendor_info_.empty() && gpu_info.gl_vendor.empty()) |
| 1323 return true; | 1342 return true; |
| 1324 if (!gl_renderer_info_.empty() && gpu_info.gl_renderer.empty()) | 1343 if (!gl_renderer_info_.empty() && gpu_info.gl_renderer.empty()) |
| 1325 return true; | 1344 return true; |
| 1326 | 1345 |
| 1327 if (consider_exceptions) { | 1346 if (consider_exceptions) { |
| 1328 for (size_t i = 0; i < exceptions_.size(); ++i) { | 1347 for (size_t i = 0; i < exceptions_.size(); ++i) { |
| 1329 if (exceptions_[i]->NeedsMoreInfo(gpu_info, consider_exceptions)) | 1348 if (exceptions_[i]->NeedsMoreInfo(gpu_info, consider_exceptions)) |
| 1330 return true; | 1349 return true; |
| 1331 } | 1350 } |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 const std::string& feature_name, int feature_id) { | 1632 const std::string& feature_name, int feature_id) { |
| 1614 feature_map_[feature_name] = feature_id; | 1633 feature_map_[feature_name] = feature_id; |
| 1615 } | 1634 } |
| 1616 | 1635 |
| 1617 void GpuControlList::set_supports_feature_type_all(bool supported) { | 1636 void GpuControlList::set_supports_feature_type_all(bool supported) { |
| 1618 supports_feature_type_all_ = supported; | 1637 supports_feature_type_all_ = supported; |
| 1619 } | 1638 } |
| 1620 | 1639 |
| 1621 } // namespace gpu | 1640 } // namespace gpu |
| 1622 | 1641 |
| OLD | NEW |