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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 if (workarounds->max_cube_map_texture_size_limit_512) | 96 if (workarounds->max_cube_map_texture_size_limit_512) |
97 workarounds->max_cube_map_texture_size = 512; | 97 workarounds->max_cube_map_texture_size = 512; |
98 } | 98 } |
99 | 99 |
100 } // anonymous namespace. | 100 } // anonymous namespace. |
101 | 101 |
102 FeatureInfo::FeatureFlags::FeatureFlags() | 102 FeatureInfo::FeatureFlags::FeatureFlags() |
103 : chromium_color_buffer_float_rgba(false), | 103 : chromium_color_buffer_float_rgba(false), |
104 chromium_color_buffer_float_rgb(false), | 104 chromium_color_buffer_float_rgb(false), |
105 chromium_framebuffer_multisample(false), | 105 chromium_framebuffer_multisample(false), |
106 chromium_sync_query(false), | |
107 use_core_framebuffer_multisample(false), | 106 use_core_framebuffer_multisample(false), |
108 multisampled_render_to_texture(false), | 107 multisampled_render_to_texture(false), |
109 use_img_for_multisampled_render_to_texture(false), | 108 use_img_for_multisampled_render_to_texture(false), |
110 oes_standard_derivatives(false), | 109 oes_standard_derivatives(false), |
111 oes_egl_image_external(false), | 110 oes_egl_image_external(false), |
112 oes_depth24(false), | 111 oes_depth24(false), |
113 oes_compressed_etc1_rgb8_texture(false), | 112 oes_compressed_etc1_rgb8_texture(false), |
114 packed_depth24_stencil8(false), | 113 packed_depth24_stencil8(false), |
115 npot_ok(false), | 114 npot_ok(false), |
116 enable_texture_float_linear(false), | 115 enable_texture_float_linear(false), |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") | 770 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") |
772 // when available. | 771 // when available. |
773 } | 772 } |
774 | 773 |
775 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && | 774 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && |
776 !workarounds_.disable_ext_discard_framebuffer) { | 775 !workarounds_.disable_ext_discard_framebuffer) { |
777 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. | 776 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. |
778 AddExtensionString("GL_EXT_discard_framebuffer"); | 777 AddExtensionString("GL_EXT_discard_framebuffer"); |
779 feature_flags_.ext_discard_framebuffer = true; | 778 feature_flags_.ext_discard_framebuffer = true; |
780 } | 779 } |
781 | |
782 if (ui_gl_fence_works) { | |
783 AddExtensionString("GL_CHROMIUM_sync_query"); | |
784 feature_flags_.chromium_sync_query = true; | |
785 } | |
786 } | 780 } |
787 | 781 |
788 void FeatureInfo::AddExtensionString(const std::string& str) { | 782 void FeatureInfo::AddExtensionString(const std::string& str) { |
789 size_t pos = extensions_.find(str); | 783 size_t pos = extensions_.find(str); |
790 while (pos != std::string::npos && | 784 while (pos != std::string::npos && |
791 pos + str.length() < extensions_.length() && | 785 pos + str.length() < extensions_.length() && |
792 extensions_.substr(pos + str.length(), 1) != " ") { | 786 extensions_.substr(pos + str.length(), 1) != " ") { |
793 // This extension name is a substring of another. | 787 // This extension name is a substring of another. |
794 pos = extensions_.find(str, pos + str.length()); | 788 pos = extensions_.find(str, pos + str.length()); |
795 } | 789 } |
796 if (pos == std::string::npos) { | 790 if (pos == std::string::npos) { |
797 extensions_ += (extensions_.empty() ? "" : " ") + str; | 791 extensions_ += (extensions_.empty() ? "" : " ") + str; |
798 } | 792 } |
799 } | 793 } |
800 | 794 |
801 FeatureInfo::~FeatureInfo() { | 795 FeatureInfo::~FeatureInfo() { |
802 } | 796 } |
803 | 797 |
804 } // namespace gles2 | 798 } // namespace gles2 |
805 } // namespace gpu | 799 } // namespace gpu |
OLD | NEW |