OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "gpu/command_buffer/service/gl_utils.h" | 15 #include "gpu/command_buffer/service/gl_utils.h" |
16 #include "gpu/command_buffer/service/gpu_switches.h" | 16 #include "gpu/command_buffer/service/gpu_switches.h" |
17 #include "ui/gl/gl_fence.h" | 17 #include "ui/gl/gl_fence.h" |
18 #include "ui/gl/gl_implementation.h" | 18 #include "ui/gl/gl_implementation.h" |
19 | 19 |
| 20 #if !defined(OS_MACOSX) |
| 21 #include "ui/gl/gl_fence_egl.h" |
| 22 #endif |
| 23 |
20 namespace gpu { | 24 namespace gpu { |
21 namespace gles2 { | 25 namespace gles2 { |
22 | 26 |
23 namespace { | 27 namespace { |
24 | 28 |
25 struct FormatInfo { | 29 struct FormatInfo { |
26 GLenum format; | 30 GLenum format; |
27 const GLenum* types; | 31 const GLenum* types; |
28 size_t count; | 32 size_t count; |
29 }; | 33 }; |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 | 1017 |
1014 if (enable_texture_float) { | 1018 if (enable_texture_float) { |
1015 texture_format_validators_[GL_RED_EXT].AddValue(GL_FLOAT); | 1019 texture_format_validators_[GL_RED_EXT].AddValue(GL_FLOAT); |
1016 texture_format_validators_[GL_RG_EXT].AddValue(GL_FLOAT); | 1020 texture_format_validators_[GL_RG_EXT].AddValue(GL_FLOAT); |
1017 } | 1021 } |
1018 if (enable_texture_half_float) { | 1022 if (enable_texture_half_float) { |
1019 texture_format_validators_[GL_RED_EXT].AddValue(GL_HALF_FLOAT_OES); | 1023 texture_format_validators_[GL_RED_EXT].AddValue(GL_HALF_FLOAT_OES); |
1020 texture_format_validators_[GL_RG_EXT].AddValue(GL_HALF_FLOAT_OES); | 1024 texture_format_validators_[GL_RG_EXT].AddValue(GL_HALF_FLOAT_OES); |
1021 } | 1025 } |
1022 } | 1026 } |
| 1027 |
| 1028 #if !defined(OS_MACOSX) |
| 1029 if (workarounds_.ignore_egl_sync_failures) { |
| 1030 gfx::GLFenceEGL::SetIgnoreFailures(); |
| 1031 } |
| 1032 #endif |
1023 } | 1033 } |
1024 | 1034 |
1025 void FeatureInfo::AddExtensionString(const char* s) { | 1035 void FeatureInfo::AddExtensionString(const char* s) { |
1026 std::string str(s); | 1036 std::string str(s); |
1027 size_t pos = extensions_.find(str); | 1037 size_t pos = extensions_.find(str); |
1028 while (pos != std::string::npos && | 1038 while (pos != std::string::npos && |
1029 pos + str.length() < extensions_.length() && | 1039 pos + str.length() < extensions_.length() && |
1030 extensions_.substr(pos + str.length(), 1) != " ") { | 1040 extensions_.substr(pos + str.length(), 1) != " ") { |
1031 // This extension name is a substring of another. | 1041 // This extension name is a substring of another. |
1032 pos = extensions_.find(str, pos + str.length()); | 1042 pos = extensions_.find(str, pos + str.length()); |
1033 } | 1043 } |
1034 if (pos == std::string::npos) { | 1044 if (pos == std::string::npos) { |
1035 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1045 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1036 } | 1046 } |
1037 } | 1047 } |
1038 | 1048 |
1039 FeatureInfo::~FeatureInfo() { | 1049 FeatureInfo::~FeatureInfo() { |
1040 } | 1050 } |
1041 | 1051 |
1042 } // namespace gles2 | 1052 } // namespace gles2 |
1043 } // namespace gpu | 1053 } // namespace gpu |
OLD | NEW |