| 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_fence_egl.h" |
| 18 #include "ui/gl/gl_implementation.h" | 19 #include "ui/gl/gl_implementation.h" |
| 19 | 20 |
| 20 namespace gpu { | 21 namespace gpu { |
| 21 namespace gles2 { | 22 namespace gles2 { |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| 25 struct FormatInfo { | 26 struct FormatInfo { |
| 26 GLenum format; | 27 GLenum format; |
| 27 const GLenum* types; | 28 const GLenum* types; |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 | 1014 |
| 1014 if (enable_texture_float) { | 1015 if (enable_texture_float) { |
| 1015 texture_format_validators_[GL_RED_EXT].AddValue(GL_FLOAT); | 1016 texture_format_validators_[GL_RED_EXT].AddValue(GL_FLOAT); |
| 1016 texture_format_validators_[GL_RG_EXT].AddValue(GL_FLOAT); | 1017 texture_format_validators_[GL_RG_EXT].AddValue(GL_FLOAT); |
| 1017 } | 1018 } |
| 1018 if (enable_texture_half_float) { | 1019 if (enable_texture_half_float) { |
| 1019 texture_format_validators_[GL_RED_EXT].AddValue(GL_HALF_FLOAT_OES); | 1020 texture_format_validators_[GL_RED_EXT].AddValue(GL_HALF_FLOAT_OES); |
| 1020 texture_format_validators_[GL_RG_EXT].AddValue(GL_HALF_FLOAT_OES); | 1021 texture_format_validators_[GL_RG_EXT].AddValue(GL_HALF_FLOAT_OES); |
| 1021 } | 1022 } |
| 1022 } | 1023 } |
| 1024 |
| 1025 if (workarounds_.ignore_egl_sync_failures) { |
| 1026 gfx::GLFenceEGL::SetIgnoreFailures(); |
| 1027 } |
| 1023 } | 1028 } |
| 1024 | 1029 |
| 1025 void FeatureInfo::AddExtensionString(const char* s) { | 1030 void FeatureInfo::AddExtensionString(const char* s) { |
| 1026 std::string str(s); | 1031 std::string str(s); |
| 1027 size_t pos = extensions_.find(str); | 1032 size_t pos = extensions_.find(str); |
| 1028 while (pos != std::string::npos && | 1033 while (pos != std::string::npos && |
| 1029 pos + str.length() < extensions_.length() && | 1034 pos + str.length() < extensions_.length() && |
| 1030 extensions_.substr(pos + str.length(), 1) != " ") { | 1035 extensions_.substr(pos + str.length(), 1) != " ") { |
| 1031 // This extension name is a substring of another. | 1036 // This extension name is a substring of another. |
| 1032 pos = extensions_.find(str, pos + str.length()); | 1037 pos = extensions_.find(str, pos + str.length()); |
| 1033 } | 1038 } |
| 1034 if (pos == std::string::npos) { | 1039 if (pos == std::string::npos) { |
| 1035 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1040 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1036 } | 1041 } |
| 1037 } | 1042 } |
| 1038 | 1043 |
| 1039 FeatureInfo::~FeatureInfo() { | 1044 FeatureInfo::~FeatureInfo() { |
| 1040 } | 1045 } |
| 1041 | 1046 |
| 1042 } // namespace gles2 | 1047 } // namespace gles2 |
| 1043 } // namespace gpu | 1048 } // namespace gpu |
| OLD | NEW |