| 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 "gpu/command_buffer/service/texture_definition.h" |
| 17 #include "gpu/config/gpu_switches.h" | 18 #include "gpu/config/gpu_switches.h" |
| 18 #include "ui/gl/gl_fence.h" | 19 #include "ui/gl/gl_fence.h" |
| 19 #include "ui/gl/gl_implementation.h" | 20 #include "ui/gl/gl_implementation.h" |
| 20 | 21 |
| 21 #if !defined(OS_MACOSX) | 22 #if !defined(OS_MACOSX) |
| 22 #include "ui/gl/gl_fence_egl.h" | 23 #include "ui/gl/gl_fence_egl.h" |
| 23 #endif | 24 #endif |
| 24 | 25 |
| 25 namespace gpu { | 26 namespace gpu { |
| 26 namespace gles2 { | 27 namespace gles2 { |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 } | 1094 } |
| 1094 } | 1095 } |
| 1095 UMA_HISTOGRAM_BOOLEAN("GPU.TextureRG", feature_flags_.ext_texture_rg); | 1096 UMA_HISTOGRAM_BOOLEAN("GPU.TextureRG", feature_flags_.ext_texture_rg); |
| 1096 | 1097 |
| 1097 #if !defined(OS_MACOSX) | 1098 #if !defined(OS_MACOSX) |
| 1098 if (workarounds_.ignore_egl_sync_failures) { | 1099 if (workarounds_.ignore_egl_sync_failures) { |
| 1099 gfx::GLFenceEGL::SetIgnoreFailures(); | 1100 gfx::GLFenceEGL::SetIgnoreFailures(); |
| 1100 } | 1101 } |
| 1101 #endif | 1102 #endif |
| 1102 | 1103 |
| 1104 if (workarounds_.avoid_egl_image_target_texture_reuse) { |
| 1105 TextureDefinition::AvoidEGLTargetTextureReuse(); |
| 1106 } |
| 1107 |
| 1103 if (gl_version_info_->IsLowerThanGL(4, 3)) { | 1108 if (gl_version_info_->IsLowerThanGL(4, 3)) { |
| 1104 // crbug.com/481184. | 1109 // crbug.com/481184. |
| 1105 // GL_PRIMITIVE_RESTART_FIXED_INDEX is only available on Desktop GL 4.3+, | 1110 // GL_PRIMITIVE_RESTART_FIXED_INDEX is only available on Desktop GL 4.3+, |
| 1106 // but we emulate ES 3.0 on top of Desktop GL 4.2+. | 1111 // but we emulate ES 3.0 on top of Desktop GL 4.2+. |
| 1107 feature_flags_.emulate_primitive_restart_fixed_index = true; | 1112 feature_flags_.emulate_primitive_restart_fixed_index = true; |
| 1108 } | 1113 } |
| 1109 } | 1114 } |
| 1110 | 1115 |
| 1111 bool FeatureInfo::IsES3Capable() const { | 1116 bool FeatureInfo::IsES3Capable() const { |
| 1112 if (gl_version_info_->IsAtLeastGLES(3, 0)) | 1117 if (gl_version_info_->IsAtLeastGLES(3, 0)) |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 if (pos == std::string::npos) { | 1200 if (pos == std::string::npos) { |
| 1196 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1201 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1197 } | 1202 } |
| 1198 } | 1203 } |
| 1199 | 1204 |
| 1200 FeatureInfo::~FeatureInfo() { | 1205 FeatureInfo::~FeatureInfo() { |
| 1201 } | 1206 } |
| 1202 | 1207 |
| 1203 } // namespace gles2 | 1208 } // namespace gles2 |
| 1204 } // namespace gpu | 1209 } // namespace gpu |
| OLD | NEW |