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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 enable_samplers(false), | 127 enable_samplers(false), |
128 ext_draw_buffers(false), | 128 ext_draw_buffers(false), |
129 ext_frag_depth(false), | 129 ext_frag_depth(false), |
130 use_async_readpixels(false), | 130 use_async_readpixels(false), |
131 map_buffer_range(false), | 131 map_buffer_range(false), |
132 ext_discard_framebuffer(false), | 132 ext_discard_framebuffer(false), |
133 angle_depth_texture(false), | 133 angle_depth_texture(false), |
134 is_angle(false), | 134 is_angle(false), |
135 is_swiftshader(false), | 135 is_swiftshader(false), |
136 angle_texture_usage(false), | 136 angle_texture_usage(false), |
137 ext_texture_storage(false) { | 137 ext_texture_storage(false), |
| 138 chromium_path_rendering(false) { |
138 } | 139 } |
139 | 140 |
140 FeatureInfo::Workarounds::Workarounds() : | 141 FeatureInfo::Workarounds::Workarounds() : |
141 #define GPU_OP(type, name) name(false), | 142 #define GPU_OP(type, name) name(false), |
142 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 143 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
143 #undef GPU_OP | 144 #undef GPU_OP |
144 max_texture_size(0), | 145 max_texture_size(0), |
145 max_cube_map_texture_size(0) { | 146 max_cube_map_texture_size(0) { |
146 } | 147 } |
147 | 148 |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") | 770 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") |
770 // when available. | 771 // when available. |
771 } | 772 } |
772 | 773 |
773 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && | 774 if ((is_es3 || extensions.Contains("GL_EXT_discard_framebuffer")) && |
774 !workarounds_.disable_ext_discard_framebuffer) { | 775 !workarounds_.disable_ext_discard_framebuffer) { |
775 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. | 776 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. |
776 AddExtensionString("GL_EXT_discard_framebuffer"); | 777 AddExtensionString("GL_EXT_discard_framebuffer"); |
777 feature_flags_.ext_discard_framebuffer = true; | 778 feature_flags_.ext_discard_framebuffer = true; |
778 } | 779 } |
| 780 |
| 781 if (extensions.Contains("GL_NV_path_rendering") && |
| 782 extensions.Contains("GL_EXT_direct_state_access")) { |
| 783 AddExtensionString("GL_CHROMIUM_path_rendering"); |
| 784 feature_flags_.chromium_path_rendering = true; |
| 785 validators_.g_l_state.AddValue(GL_MODELVIEW_MATRIX_CHROMIUM); |
| 786 validators_.g_l_state.AddValue(GL_PROJECTION_MATRIX_CHROMIUM); |
| 787 } |
779 } | 788 } |
780 | 789 |
781 void FeatureInfo::AddExtensionString(const std::string& str) { | 790 void FeatureInfo::AddExtensionString(const std::string& str) { |
782 size_t pos = extensions_.find(str); | 791 size_t pos = extensions_.find(str); |
783 while (pos != std::string::npos && | 792 while (pos != std::string::npos && |
784 pos + str.length() < extensions_.length() && | 793 pos + str.length() < extensions_.length() && |
785 extensions_.substr(pos + str.length(), 1) != " ") { | 794 extensions_.substr(pos + str.length(), 1) != " ") { |
786 // This extension name is a substring of another. | 795 // This extension name is a substring of another. |
787 pos = extensions_.find(str, pos + str.length()); | 796 pos = extensions_.find(str, pos + str.length()); |
788 } | 797 } |
789 if (pos == std::string::npos) { | 798 if (pos == std::string::npos) { |
790 extensions_ += (extensions_.empty() ? "" : " ") + str; | 799 extensions_ += (extensions_.empty() ? "" : " ") + str; |
791 } | 800 } |
792 } | 801 } |
793 | 802 |
794 FeatureInfo::~FeatureInfo() { | 803 FeatureInfo::~FeatureInfo() { |
795 } | 804 } |
796 | 805 |
797 } // namespace gles2 | 806 } // namespace gles2 |
798 } // namespace gpu | 807 } // namespace gpu |
OLD | NEW |