Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "gpu/command_buffer/common/gl_mock.h" | 8 #include "gpu/command_buffer/common/gl_mock.h" |
| 9 #include "gpu/command_buffer/service/test_helper.h" | 9 #include "gpu/command_buffer/service/test_helper.h" |
| 10 #include "gpu/command_buffer/service/texture_manager.h" | 10 #include "gpu/command_buffer/service/texture_manager.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 FeatureInfo info_; | 52 FeatureInfo info_; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 TEST_F(FeatureInfoTest, Basic) { | 55 TEST_F(FeatureInfoTest, Basic) { |
| 56 // Test it starts off uninitialized. | 56 // Test it starts off uninitialized. |
| 57 EXPECT_FALSE(info_.feature_flags().chromium_framebuffer_multisample); | 57 EXPECT_FALSE(info_.feature_flags().chromium_framebuffer_multisample); |
| 58 EXPECT_FALSE(info_.feature_flags().oes_standard_derivatives); | 58 EXPECT_FALSE(info_.feature_flags().oes_standard_derivatives); |
| 59 EXPECT_FALSE(info_.feature_flags().npot_ok); | 59 EXPECT_FALSE(info_.feature_flags().npot_ok); |
| 60 EXPECT_FALSE(info_.feature_flags().enable_texture_float_linear); | 60 EXPECT_FALSE(info_.feature_flags().enable_texture_float_linear); |
| 61 EXPECT_FALSE(info_.feature_flags().enable_texture_half_float_linear); | 61 EXPECT_FALSE(info_.feature_flags().enable_texture_half_float_linear); |
| 62 EXPECT_FALSE(info_.feature_flags().chromium_webglsl); | 62 EXPECT_FALSE(info_.feature_flags().chromium_webglsl); |
|
greggman
2011/07/20 01:41:18
Can you add a test that oes_egl_image_external is
| |
| 63 } | 63 } |
| 64 | 64 |
| 65 TEST_F(FeatureInfoTest, InitializeNoExtensions) { | 65 TEST_F(FeatureInfoTest, InitializeNoExtensions) { |
| 66 SetupInitExpectations(""); | 66 SetupInitExpectations(""); |
| 67 info_.Initialize(NULL); | 67 info_.Initialize(NULL); |
| 68 // Check default extensions are there | 68 // Check default extensions are there |
| 69 EXPECT_THAT(info_.extensions(), HasSubstr("GL_CHROMIUM_map_sub")); | 69 EXPECT_THAT(info_.extensions(), HasSubstr("GL_CHROMIUM_map_sub")); |
| 70 EXPECT_THAT(info_.extensions(), | 70 EXPECT_THAT(info_.extensions(), |
| 71 HasSubstr("GL_CHROMIUM_copy_texture_to_parent_texture")); | 71 HasSubstr("GL_CHROMIUM_copy_texture_to_parent_texture")); |
| 72 EXPECT_THAT(info_.extensions(), HasSubstr("GL_CHROMIUM_resource_safe")); | 72 EXPECT_THAT(info_.extensions(), HasSubstr("GL_CHROMIUM_resource_safe")); |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 SetupInitExpectations("GL_OES_rgb8_rgba8"); | 407 SetupInitExpectations("GL_OES_rgb8_rgba8"); |
| 408 info_.Initialize(NULL); | 408 info_.Initialize(NULL); |
| 409 EXPECT_THAT(info_.extensions(), | 409 EXPECT_THAT(info_.extensions(), |
| 410 HasSubstr("GL_OES_rgb8_rgba8")); | 410 HasSubstr("GL_OES_rgb8_rgba8")); |
| 411 EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid( | 411 EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid( |
| 412 GL_RGB8_OES)); | 412 GL_RGB8_OES)); |
| 413 EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid( | 413 EXPECT_TRUE(info_.validators()->render_buffer_format.IsValid( |
| 414 GL_RGBA8_OES)); | 414 GL_RGBA8_OES)); |
| 415 } | 415 } |
| 416 | 416 |
| 417 TEST_F(FeatureInfoTest, InitializeOES_EGL_image_external) { | |
| 418 SetupInitExpectations("GL_OES_EGL_image_external"); | |
| 419 info_.Initialize(NULL); | |
| 420 EXPECT_THAT(info_.extensions(), | |
| 421 HasSubstr("GL_OES_EGL_image_external")); | |
| 422 EXPECT_TRUE(info_.validators()->texture_bind_target.IsValid( | |
| 423 GL_TEXTURE_EXTERNAL_OES)); | |
| 424 EXPECT_TRUE(info_.validators()->get_tex_param_target.IsValid( | |
| 425 GL_TEXTURE_EXTERNAL_OES)); | |
| 426 EXPECT_TRUE(info_.validators()->texture_parameter.IsValid( | |
| 427 GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES)); | |
| 428 EXPECT_TRUE(info_.validators()->g_l_state.IsValid( | |
| 429 GL_TEXTURE_BINDING_EXTERNAL_OES)); | |
| 430 } | |
| 431 | |
| 417 } // namespace gles2 | 432 } // namespace gles2 |
| 418 } // namespace gpu | 433 } // namespace gpu |
| 419 | 434 |
| 420 | 435 |
| 421 | 436 |
| OLD | NEW |