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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 ext_draw_buffers(false), | 134 ext_draw_buffers(false), |
135 ext_frag_depth(false), | 135 ext_frag_depth(false), |
136 ext_shader_texture_lod(false), | 136 ext_shader_texture_lod(false), |
137 use_async_readpixels(false), | 137 use_async_readpixels(false), |
138 map_buffer_range(false), | 138 map_buffer_range(false), |
139 ext_discard_framebuffer(false), | 139 ext_discard_framebuffer(false), |
140 angle_depth_texture(false), | 140 angle_depth_texture(false), |
141 is_angle(false), | 141 is_angle(false), |
142 is_swiftshader(false), | 142 is_swiftshader(false), |
143 angle_texture_usage(false), | 143 angle_texture_usage(false), |
144 ext_texture_storage(false) { | 144 ext_texture_storage(false), |
| 145 chromium_path_rendering(false) { |
145 } | 146 } |
146 | 147 |
147 FeatureInfo::Workarounds::Workarounds() : | 148 FeatureInfo::Workarounds::Workarounds() : |
148 #define GPU_OP(type, name) name(false), | 149 #define GPU_OP(type, name) name(false), |
149 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 150 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
150 #undef GPU_OP | 151 #undef GPU_OP |
151 max_texture_size(0), | 152 max_texture_size(0), |
152 max_cube_map_texture_size(0), | 153 max_cube_map_texture_size(0), |
153 max_fragment_uniform_vectors(0), | 154 max_fragment_uniform_vectors(0), |
154 max_varying_vectors(0), | 155 max_varying_vectors(0), |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 !workarounds_.disable_ext_discard_framebuffer) { | 825 !workarounds_.disable_ext_discard_framebuffer) { |
825 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. | 826 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. |
826 AddExtensionString("GL_EXT_discard_framebuffer"); | 827 AddExtensionString("GL_EXT_discard_framebuffer"); |
827 feature_flags_.ext_discard_framebuffer = true; | 828 feature_flags_.ext_discard_framebuffer = true; |
828 } | 829 } |
829 | 830 |
830 if (ui_gl_fence_works) { | 831 if (ui_gl_fence_works) { |
831 AddExtensionString("GL_CHROMIUM_sync_query"); | 832 AddExtensionString("GL_CHROMIUM_sync_query"); |
832 feature_flags_.chromium_sync_query = true; | 833 feature_flags_.chromium_sync_query = true; |
833 } | 834 } |
| 835 |
| 836 if (extensions.Contains("GL_NV_path_rendering")) { |
| 837 if (extensions.Contains("GL_EXT_direct_state_access") || is_es3) { |
| 838 AddExtensionString("GL_CHROMIUM_path_rendering"); |
| 839 feature_flags_.chromium_path_rendering = true; |
| 840 validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM); |
| 841 validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM); |
| 842 } |
| 843 } |
834 } | 844 } |
835 | 845 |
836 void FeatureInfo::AddExtensionString(const std::string& str) { | 846 void FeatureInfo::AddExtensionString(const std::string& str) { |
837 size_t pos = extensions_.find(str); | 847 size_t pos = extensions_.find(str); |
838 while (pos != std::string::npos && | 848 while (pos != std::string::npos && |
839 pos + str.length() < extensions_.length() && | 849 pos + str.length() < extensions_.length() && |
840 extensions_.substr(pos + str.length(), 1) != " ") { | 850 extensions_.substr(pos + str.length(), 1) != " ") { |
841 // This extension name is a substring of another. | 851 // This extension name is a substring of another. |
842 pos = extensions_.find(str, pos + str.length()); | 852 pos = extensions_.find(str, pos + str.length()); |
843 } | 853 } |
844 if (pos == std::string::npos) { | 854 if (pos == std::string::npos) { |
845 extensions_ += (extensions_.empty() ? "" : " ") + str; | 855 extensions_ += (extensions_.empty() ? "" : " ") + str; |
846 } | 856 } |
847 } | 857 } |
848 | 858 |
849 FeatureInfo::~FeatureInfo() { | 859 FeatureInfo::~FeatureInfo() { |
850 } | 860 } |
851 | 861 |
852 } // namespace gles2 | 862 } // namespace gles2 |
853 } // namespace gpu | 863 } // namespace gpu |
OLD | NEW |