| 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 !workarounds_.disable_ext_discard_framebuffer) { | 827 !workarounds_.disable_ext_discard_framebuffer) { |
| 827 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. | 828 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. |
| 828 AddExtensionString("GL_EXT_discard_framebuffer"); | 829 AddExtensionString("GL_EXT_discard_framebuffer"); |
| 829 feature_flags_.ext_discard_framebuffer = true; | 830 feature_flags_.ext_discard_framebuffer = true; |
| 830 } | 831 } |
| 831 | 832 |
| 832 if (ui_gl_fence_works) { | 833 if (ui_gl_fence_works) { |
| 833 AddExtensionString("GL_CHROMIUM_sync_query"); | 834 AddExtensionString("GL_CHROMIUM_sync_query"); |
| 834 feature_flags_.chromium_sync_query = true; | 835 feature_flags_.chromium_sync_query = true; |
| 835 } | 836 } |
| 837 |
| 838 if (extensions.Contains("GL_NV_path_rendering")) { |
| 839 if (extensions.Contains("GL_EXT_direct_state_access") || |
| 840 is_es3) { |
| 841 AddExtensionString("GL_CHROMIUM_path_rendering"); |
| 842 feature_flags_.chromium_path_rendering = true; |
| 843 validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM); |
| 844 validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM); |
| 845 } |
| 846 } |
| 836 } | 847 } |
| 837 | 848 |
| 838 void FeatureInfo::AddExtensionString(const std::string& str) { | 849 void FeatureInfo::AddExtensionString(const std::string& str) { |
| 839 size_t pos = extensions_.find(str); | 850 size_t pos = extensions_.find(str); |
| 840 while (pos != std::string::npos && | 851 while (pos != std::string::npos && |
| 841 pos + str.length() < extensions_.length() && | 852 pos + str.length() < extensions_.length() && |
| 842 extensions_.substr(pos + str.length(), 1) != " ") { | 853 extensions_.substr(pos + str.length(), 1) != " ") { |
| 843 // This extension name is a substring of another. | 854 // This extension name is a substring of another. |
| 844 pos = extensions_.find(str, pos + str.length()); | 855 pos = extensions_.find(str, pos + str.length()); |
| 845 } | 856 } |
| 846 if (pos == std::string::npos) { | 857 if (pos == std::string::npos) { |
| 847 extensions_ += (extensions_.empty() ? "" : " ") + str; | 858 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 848 } | 859 } |
| 849 } | 860 } |
| 850 | 861 |
| 851 FeatureInfo::~FeatureInfo() { | 862 FeatureInfo::~FeatureInfo() { |
| 852 } | 863 } |
| 853 | 864 |
| 854 } // namespace gles2 | 865 } // namespace gles2 |
| 855 } // namespace gpu | 866 } // namespace gpu |
| OLD | NEW |