| 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" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (workarounds->max_vertex_uniform_vectors_256) | 103 if (workarounds->max_vertex_uniform_vectors_256) |
| 104 workarounds->max_vertex_uniform_vectors = 256; | 104 workarounds->max_vertex_uniform_vectors = 256; |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // anonymous namespace. | 107 } // anonymous namespace. |
| 108 | 108 |
| 109 FeatureInfo::FeatureFlags::FeatureFlags() | 109 FeatureInfo::FeatureFlags::FeatureFlags() |
| 110 : chromium_color_buffer_float_rgba(false), | 110 : chromium_color_buffer_float_rgba(false), |
| 111 chromium_color_buffer_float_rgb(false), | 111 chromium_color_buffer_float_rgb(false), |
| 112 chromium_framebuffer_multisample(false), | 112 chromium_framebuffer_multisample(false), |
| 113 chromium_sync_query(false), |
| 113 use_core_framebuffer_multisample(false), | 114 use_core_framebuffer_multisample(false), |
| 114 multisampled_render_to_texture(false), | 115 multisampled_render_to_texture(false), |
| 115 use_img_for_multisampled_render_to_texture(false), | 116 use_img_for_multisampled_render_to_texture(false), |
| 116 oes_standard_derivatives(false), | 117 oes_standard_derivatives(false), |
| 117 oes_egl_image_external(false), | 118 oes_egl_image_external(false), |
| 118 oes_depth24(false), | 119 oes_depth24(false), |
| 119 oes_compressed_etc1_rgb8_texture(false), | 120 oes_compressed_etc1_rgb8_texture(false), |
| 120 packed_depth24_stencil8(false), | 121 packed_depth24_stencil8(false), |
| 121 npot_ok(false), | 122 npot_ok(false), |
| 122 enable_texture_float_linear(false), | 123 enable_texture_float_linear(false), |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") | 788 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") |
| 788 // when available. | 789 // when available. |
| 789 } | 790 } |
| 790 | 791 |
| 791 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && | 792 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && |
| 792 !workarounds_.disable_ext_discard_framebuffer) { | 793 !workarounds_.disable_ext_discard_framebuffer) { |
| 793 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. | 794 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. |
| 794 AddExtensionString("GL_EXT_discard_framebuffer"); | 795 AddExtensionString("GL_EXT_discard_framebuffer"); |
| 795 feature_flags_.ext_discard_framebuffer = true; | 796 feature_flags_.ext_discard_framebuffer = true; |
| 796 } | 797 } |
| 798 |
| 799 if (ui_gl_fence_works) { |
| 800 AddExtensionString("GL_CHROMIUM_sync_query"); |
| 801 feature_flags_.chromium_sync_query = true; |
| 802 } |
| 797 } | 803 } |
| 798 | 804 |
| 799 void FeatureInfo::AddExtensionString(const std::string& str) { | 805 void FeatureInfo::AddExtensionString(const std::string& str) { |
| 800 size_t pos = extensions_.find(str); | 806 size_t pos = extensions_.find(str); |
| 801 while (pos != std::string::npos && | 807 while (pos != std::string::npos && |
| 802 pos + str.length() < extensions_.length() && | 808 pos + str.length() < extensions_.length() && |
| 803 extensions_.substr(pos + str.length(), 1) != " ") { | 809 extensions_.substr(pos + str.length(), 1) != " ") { |
| 804 // This extension name is a substring of another. | 810 // This extension name is a substring of another. |
| 805 pos = extensions_.find(str, pos + str.length()); | 811 pos = extensions_.find(str, pos + str.length()); |
| 806 } | 812 } |
| 807 if (pos == std::string::npos) { | 813 if (pos == std::string::npos) { |
| 808 extensions_ += (extensions_.empty() ? "" : " ") + str; | 814 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 809 } | 815 } |
| 810 } | 816 } |
| 811 | 817 |
| 812 FeatureInfo::~FeatureInfo() { | 818 FeatureInfo::~FeatureInfo() { |
| 813 } | 819 } |
| 814 | 820 |
| 815 } // namespace gles2 | 821 } // namespace gles2 |
| 816 } // namespace gpu | 822 } // namespace gpu |
| OLD | NEW |