| 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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "gpu/command_buffer/service/test_helper.h" | 8 #include "gpu/command_buffer/service/test_helper.h" |
| 9 #include "gpu/command_buffer/service/texture_manager.h" | 9 #include "gpu/command_buffer/service/texture_manager.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 ).use_arb_occlusion_query2_for_occlusion_query_boolean); | 88 ).use_arb_occlusion_query2_for_occlusion_query_boolean); |
| 89 EXPECT_FALSE(info_->feature_flags( | 89 EXPECT_FALSE(info_->feature_flags( |
| 90 ).use_arb_occlusion_query_for_occlusion_query_boolean); | 90 ).use_arb_occlusion_query_for_occlusion_query_boolean); |
| 91 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); | 91 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); |
| 92 EXPECT_FALSE(info_->workarounds().reverse_point_sprite_coord_origin); | 92 EXPECT_FALSE(info_->workarounds().reverse_point_sprite_coord_origin); |
| 93 EXPECT_FALSE( | 93 EXPECT_FALSE( |
| 94 info_->workarounds().set_texture_filter_before_generating_mipmap); | 94 info_->workarounds().set_texture_filter_before_generating_mipmap); |
| 95 EXPECT_FALSE(info_->workarounds().clear_alpha_in_readpixels); | 95 EXPECT_FALSE(info_->workarounds().clear_alpha_in_readpixels); |
| 96 EXPECT_EQ(0, info_->workarounds().max_texture_size); | 96 EXPECT_EQ(0, info_->workarounds().max_texture_size); |
| 97 EXPECT_EQ(0, info_->workarounds().max_cube_map_texture_size); | 97 EXPECT_EQ(0, info_->workarounds().max_cube_map_texture_size); |
| 98 EXPECT_FALSE(info_->workarounds().use_client_side_arrays_for_stream_buffers); |
| 98 | 99 |
| 99 // Test good types. | 100 // Test good types. |
| 100 { | 101 { |
| 101 static const GLenum kAlphaTypes[] = { | 102 static const GLenum kAlphaTypes[] = { |
| 102 GL_UNSIGNED_BYTE, | 103 GL_UNSIGNED_BYTE, |
| 103 }; | 104 }; |
| 104 static const GLenum kRGBTypes[] = { | 105 static const GLenum kRGBTypes[] = { |
| 105 GL_UNSIGNED_BYTE, | 106 GL_UNSIGNED_BYTE, |
| 106 GL_UNSIGNED_SHORT_5_6_5, | 107 GL_UNSIGNED_SHORT_5_6_5, |
| 107 }; | 108 }; |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 } | 793 } |
| 793 | 794 |
| 794 TEST_F(FeatureInfoTest, InitializeOES_element_index_uint) { | 795 TEST_F(FeatureInfoTest, InitializeOES_element_index_uint) { |
| 795 SetupInitExpectations("GL_OES_element_index_uint"); | 796 SetupInitExpectations("GL_OES_element_index_uint"); |
| 796 info_->Initialize(NULL); | 797 info_->Initialize(NULL); |
| 797 EXPECT_THAT(info_->extensions(), | 798 EXPECT_THAT(info_->extensions(), |
| 798 HasSubstr("GL_OES_element_index_uint")); | 799 HasSubstr("GL_OES_element_index_uint")); |
| 799 EXPECT_TRUE(info_->validators()->index_type.IsValid(GL_UNSIGNED_INT)); | 800 EXPECT_TRUE(info_->validators()->index_type.IsValid(GL_UNSIGNED_INT)); |
| 800 } | 801 } |
| 801 | 802 |
| 803 TEST_F(FeatureInfoTest, InitializeARM) { |
| 804 SetupInitExpectationsWithVendor("", "ARM", "MAli-T604"); |
| 805 info_->Initialize(NULL); |
| 806 EXPECT_TRUE(info_->workarounds().use_client_side_arrays_for_stream_buffers); |
| 807 } |
| 808 |
| 809 TEST_F(FeatureInfoTest, InitializeImagination) { |
| 810 SetupInitExpectationsWithVendor( |
| 811 "", "Imagination Techologies", "PowerVR SGX 540"); |
| 812 info_->Initialize(NULL); |
| 813 EXPECT_TRUE(info_->workarounds().use_client_side_arrays_for_stream_buffers); |
| 814 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); |
| 815 } |
| 816 |
| 817 TEST_F(FeatureInfoTest, InitializeARMVAOs) { |
| 818 SetupInitExpectationsWithVendor( |
| 819 "GL_OES_vertex_array_object", "ARM", "MAli-T604"); |
| 820 info_->Initialize(NULL); |
| 821 EXPECT_TRUE(info_->workarounds().use_client_side_arrays_for_stream_buffers); |
| 822 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); |
| 823 } |
| 824 |
| 825 TEST_F(FeatureInfoTest, InitializeImaginationVAOs) { |
| 826 SetupInitExpectationsWithVendor( |
| 827 "GL_OES_vertex_array_object", |
| 828 "Imagination Techologies", "PowerVR SGX 540"); |
| 829 info_->Initialize(NULL); |
| 830 EXPECT_TRUE(info_->workarounds().use_client_side_arrays_for_stream_buffers); |
| 831 } |
| 832 |
| 802 } // namespace gles2 | 833 } // namespace gles2 |
| 803 } // namespace gpu | 834 } // namespace gpu |
| OLD | NEW |