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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "gpu/command_buffer/service/gpu_switches.h" | 10 #include "gpu/command_buffer/service/gpu_switches.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid( | 309 EXPECT_FALSE(info_->validators()->render_buffer_format.IsValid( |
310 GL_DEPTH_COMPONENT24)); | 310 GL_DEPTH_COMPONENT24)); |
311 EXPECT_FALSE(info_->validators()->texture_parameter.IsValid( | 311 EXPECT_FALSE(info_->validators()->texture_parameter.IsValid( |
312 GL_TEXTURE_USAGE_ANGLE)); | 312 GL_TEXTURE_USAGE_ANGLE)); |
313 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( | 313 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( |
314 GL_DEPTH_COMPONENT16)); | 314 GL_DEPTH_COMPONENT16)); |
315 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( | 315 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( |
316 GL_DEPTH_COMPONENT32_OES)); | 316 GL_DEPTH_COMPONENT32_OES)); |
317 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( | 317 EXPECT_FALSE(info_->validators()->texture_internal_format_storage.IsValid( |
318 GL_DEPTH24_STENCIL8_OES)); | 318 GL_DEPTH24_STENCIL8_OES)); |
| 319 EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MIN_EXT)); |
| 320 EXPECT_FALSE(info_->validators()->equation.IsValid(GL_MAX_EXT)); |
319 } | 321 } |
320 | 322 |
321 TEST_F(FeatureInfoTest, InitializeWithANGLE) { | 323 TEST_F(FeatureInfoTest, InitializeWithANGLE) { |
322 SetupInitExpectationsWithGLVersion("", kGLRendererStringANGLE, ""); | 324 SetupInitExpectationsWithGLVersion("", kGLRendererStringANGLE, ""); |
323 EXPECT_TRUE(info_->feature_flags().is_angle); | 325 EXPECT_TRUE(info_->feature_flags().is_angle); |
324 } | 326 } |
325 | 327 |
326 TEST_F(FeatureInfoTest, InitializeNPOTExtensionGLES) { | 328 TEST_F(FeatureInfoTest, InitializeNPOTExtensionGLES) { |
327 SetupInitExpectations("GL_OES_texture_npot"); | 329 SetupInitExpectations("GL_OES_texture_npot"); |
328 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_texture_npot")); | 330 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_texture_npot")); |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 CommandLine command_line(0, NULL); | 947 CommandLine command_line(0, NULL); |
946 command_line.AppendSwitchASCII( | 948 command_line.AppendSwitchASCII( |
947 switches::kGpuDriverBugWorkarounds, | 949 switches::kGpuDriverBugWorkarounds, |
948 base::IntToString(gpu::USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS)); | 950 base::IntToString(gpu::USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS)); |
949 SetupInitExpectationsWithCommandLine("GL_OES_vertex_array_object", | 951 SetupInitExpectationsWithCommandLine("GL_OES_vertex_array_object", |
950 command_line); | 952 command_line); |
951 EXPECT_TRUE(info_->workarounds().use_client_side_arrays_for_stream_buffers); | 953 EXPECT_TRUE(info_->workarounds().use_client_side_arrays_for_stream_buffers); |
952 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); | 954 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); |
953 } | 955 } |
954 | 956 |
| 957 TEST_F(FeatureInfoTest, InitializeEXT_blend_minmax) { |
| 958 SetupInitExpectations("GL_EXT_blend_minmax"); |
| 959 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_blend_minmax")); |
| 960 EXPECT_TRUE(info_->validators()->equation.IsValid(GL_MIN_EXT)); |
| 961 EXPECT_TRUE(info_->validators()->equation.IsValid(GL_MAX_EXT)); |
| 962 } |
| 963 |
955 TEST_F(FeatureInfoTest, InitializeEXT_frag_depth) { | 964 TEST_F(FeatureInfoTest, InitializeEXT_frag_depth) { |
956 SetupInitExpectations("GL_EXT_frag_depth"); | 965 SetupInitExpectations("GL_EXT_frag_depth"); |
957 EXPECT_TRUE(info_->feature_flags().ext_frag_depth); | 966 EXPECT_TRUE(info_->feature_flags().ext_frag_depth); |
958 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_frag_depth")); | 967 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_frag_depth")); |
959 } | 968 } |
960 | 969 |
961 TEST_F(FeatureInfoTest, InitializeEXT_shader_texture_lod) { | 970 TEST_F(FeatureInfoTest, InitializeEXT_shader_texture_lod) { |
962 SetupInitExpectations("GL_EXT_shader_texture_lod"); | 971 SetupInitExpectations("GL_EXT_shader_texture_lod"); |
963 EXPECT_TRUE(info_->feature_flags().ext_shader_texture_lod); | 972 EXPECT_TRUE(info_->feature_flags().ext_shader_texture_lod); |
964 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_shader_texture_lod")); | 973 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_shader_texture_lod")); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 base::IntToString(gpu::MAX_TEXTURE_SIZE_LIMIT_4096)); | 1046 base::IntToString(gpu::MAX_TEXTURE_SIZE_LIMIT_4096)); |
1038 // Workarounds should get parsed without the need for a context. | 1047 // Workarounds should get parsed without the need for a context. |
1039 SetupWithCommandLine(command_line); | 1048 SetupWithCommandLine(command_line); |
1040 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); | 1049 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); |
1041 EXPECT_EQ(1024, info_->workarounds().max_cube_map_texture_size); | 1050 EXPECT_EQ(1024, info_->workarounds().max_cube_map_texture_size); |
1042 EXPECT_EQ(4096, info_->workarounds().max_texture_size); | 1051 EXPECT_EQ(4096, info_->workarounds().max_texture_size); |
1043 } | 1052 } |
1044 | 1053 |
1045 } // namespace gles2 | 1054 } // namespace gles2 |
1046 } // namespace gpu | 1055 } // namespace gpu |
OLD | NEW |