Chromium Code Reviews| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 chromium_path_rendering(false), |
| 146 ext_blend_minmax(false) { | 146 ext_blend_minmax(false), |
| 147 blend_equation_advanced(false) { | |
| 147 } | 148 } |
| 148 | 149 |
| 149 FeatureInfo::Workarounds::Workarounds() : | 150 FeatureInfo::Workarounds::Workarounds() : |
| 150 #define GPU_OP(type, name) name(false), | 151 #define GPU_OP(type, name) name(false), |
| 151 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 152 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 152 #undef GPU_OP | 153 #undef GPU_OP |
| 153 max_texture_size(0), | 154 max_texture_size(0), |
| 154 max_cube_map_texture_size(0), | 155 max_cube_map_texture_size(0), |
| 155 max_fragment_uniform_vectors(0), | 156 max_fragment_uniform_vectors(0), |
| 156 max_varying_vectors(0), | 157 max_varying_vectors(0), |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 845 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. | 846 // DiscardFramebufferEXT is automatically bound to InvalidateFramebuffer. |
| 846 AddExtensionString("GL_EXT_discard_framebuffer"); | 847 AddExtensionString("GL_EXT_discard_framebuffer"); |
| 847 feature_flags_.ext_discard_framebuffer = true; | 848 feature_flags_.ext_discard_framebuffer = true; |
| 848 } | 849 } |
| 849 | 850 |
| 850 if (ui_gl_fence_works) { | 851 if (ui_gl_fence_works) { |
| 851 AddExtensionString("GL_CHROMIUM_sync_query"); | 852 AddExtensionString("GL_CHROMIUM_sync_query"); |
| 852 feature_flags_.chromium_sync_query = true; | 853 feature_flags_.chromium_sync_query = true; |
| 853 } | 854 } |
| 854 | 855 |
| 856 if (extensions.Contains("GL_NV_blend_equation_advanced") || | |
| 857 extensions.Contains("GL_KHR_blend_equation_advanced")) { | |
| 858 const GLenum equations[] = { | |
|
piman
2014/10/16 20:13:29
nit: indent looks wrong.
| |
| 859 GL_MULTIPLY_NV, | |
| 860 GL_SCREEN_NV, | |
| 861 GL_OVERLAY_NV, | |
| 862 GL_DARKEN_NV, | |
| 863 GL_LIGHTEN_NV, | |
| 864 GL_COLORDODGE_NV, | |
| 865 GL_COLORBURN_NV, | |
| 866 GL_HARDLIGHT_NV, | |
| 867 GL_SOFTLIGHT_NV, | |
| 868 GL_DIFFERENCE_NV, | |
| 869 GL_EXCLUSION_NV, | |
| 870 GL_HSL_HUE_NV, | |
| 871 GL_HSL_SATURATION_NV, | |
| 872 GL_HSL_COLOR_NV, | |
| 873 GL_HSL_LUMINOSITY_NV | |
|
piman
2014/10/16 20:13:29
If we don't support the whole range of enums, we s
Erik Dahlström (inactive)
2014/10/17 15:33:17
Done.
| |
| 874 }; | |
| 875 | |
| 876 for (const GLenum& equation : equations) | |
|
piman
2014/10/16 20:13:29
nit: const & superfluous?
Erik Dahlström (inactive)
2014/10/17 15:33:17
Done.
| |
| 877 validators_.equation.AddValue(equation); | |
| 878 AddExtensionString("GL_NV_blend_equation_advanced"); | |
| 879 feature_flags_.blend_equation_advanced = true; | |
| 880 } | |
| 881 | |
| 855 if (extensions.Contains("GL_NV_path_rendering")) { | 882 if (extensions.Contains("GL_NV_path_rendering")) { |
| 856 if (extensions.Contains("GL_EXT_direct_state_access") || is_es3) { | 883 if (extensions.Contains("GL_EXT_direct_state_access") || is_es3) { |
| 857 AddExtensionString("GL_CHROMIUM_path_rendering"); | 884 AddExtensionString("GL_CHROMIUM_path_rendering"); |
| 858 feature_flags_.chromium_path_rendering = true; | 885 feature_flags_.chromium_path_rendering = true; |
| 859 validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM); | 886 validators_.g_l_state.AddValue(GL_PATH_MODELVIEW_MATRIX_CHROMIUM); |
| 860 validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM); | 887 validators_.g_l_state.AddValue(GL_PATH_PROJECTION_MATRIX_CHROMIUM); |
| 861 } | 888 } |
| 862 } | 889 } |
| 863 } | 890 } |
| 864 | 891 |
| 865 void FeatureInfo::AddExtensionString(const char* s) { | 892 void FeatureInfo::AddExtensionString(const char* s) { |
| 866 std::string str(s); | 893 std::string str(s); |
| 867 size_t pos = extensions_.find(str); | 894 size_t pos = extensions_.find(str); |
| 868 while (pos != std::string::npos && | 895 while (pos != std::string::npos && |
| 869 pos + str.length() < extensions_.length() && | 896 pos + str.length() < extensions_.length() && |
| 870 extensions_.substr(pos + str.length(), 1) != " ") { | 897 extensions_.substr(pos + str.length(), 1) != " ") { |
| 871 // This extension name is a substring of another. | 898 // This extension name is a substring of another. |
| 872 pos = extensions_.find(str, pos + str.length()); | 899 pos = extensions_.find(str, pos + str.length()); |
| 873 } | 900 } |
| 874 if (pos == std::string::npos) { | 901 if (pos == std::string::npos) { |
| 875 extensions_ += (extensions_.empty() ? "" : " ") + str; | 902 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 876 } | 903 } |
| 877 } | 904 } |
| 878 | 905 |
| 879 FeatureInfo::~FeatureInfo() { | 906 FeatureInfo::~FeatureInfo() { |
| 880 } | 907 } |
| 881 | 908 |
| 882 } // namespace gles2 | 909 } // namespace gles2 |
| 883 } // namespace gpu | 910 } // namespace gpu |
| OLD | NEW |