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 "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 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 base::SplitString(gl_version, ' ', &segments); | 1022 base::SplitString(gl_version, ' ', &segments); |
1023 std::string number; | 1023 std::string number; |
1024 GLType gl_type = kGLTypeNone; | 1024 GLType gl_type = kGLTypeNone; |
1025 if (segments.size() > 2 && | 1025 if (segments.size() > 2 && |
1026 segments[0] == "OpenGL" && segments[1] == "ES") { | 1026 segments[0] == "OpenGL" && segments[1] == "ES") { |
1027 bool full_match = RE2::FullMatch(segments[2], "([\\d.]+).*", &number); | 1027 bool full_match = RE2::FullMatch(segments[2], "([\\d.]+).*", &number); |
1028 DCHECK(full_match); | 1028 DCHECK(full_match); |
1029 | 1029 |
1030 gl_type = kGLTypeGLES; | 1030 gl_type = kGLTypeGLES; |
1031 if (segments.size() > 3 && | 1031 if (segments.size() > 3 && |
1032 base::StartsWithASCII(segments[3], "(ANGLE", false)) { | 1032 base::StartsWith(segments[3], "(ANGLE", |
| 1033 base::CompareCase::INSENSITIVE_ASCII)) { |
1033 gl_type = kGLTypeANGLE; | 1034 gl_type = kGLTypeANGLE; |
1034 } | 1035 } |
1035 } else { | 1036 } else { |
1036 number = segments[0]; | 1037 number = segments[0]; |
1037 gl_type = kGLTypeGL; | 1038 gl_type = kGLTypeGL; |
1038 } | 1039 } |
1039 | 1040 |
1040 if (gl_type_ != kGLTypeNone && gl_type_ != gl_type) | 1041 if (gl_type_ != kGLTypeNone && gl_type_ != gl_type) |
1041 return true; | 1042 return true; |
1042 if (gl_version_info_.get() != NULL && !gl_version_info_->Contains(number)) | 1043 if (gl_version_info_.get() != NULL && !gl_version_info_->Contains(number)) |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 const std::string& feature_name, int feature_id) { | 1565 const std::string& feature_name, int feature_id) { |
1565 feature_map_[feature_name] = feature_id; | 1566 feature_map_[feature_name] = feature_id; |
1566 } | 1567 } |
1567 | 1568 |
1568 void GpuControlList::set_supports_feature_type_all(bool supported) { | 1569 void GpuControlList::set_supports_feature_type_all(bool supported) { |
1569 supports_feature_type_all_ = supported; | 1570 supports_feature_type_all_ = supported; |
1570 } | 1571 } |
1571 | 1572 |
1572 } // namespace gpu | 1573 } // namespace gpu |
1573 | 1574 |
OLD | NEW |