| 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 SetupInitExpectations("GL_OES_vertex_array_object"); | 807 SetupInitExpectations("GL_OES_vertex_array_object"); |
| 808 CommandLine command_line(0, NULL); | 808 CommandLine command_line(0, NULL); |
| 809 command_line.AppendSwitchASCII( | 809 command_line.AppendSwitchASCII( |
| 810 switches::kGpuDriverBugWorkarounds, | 810 switches::kGpuDriverBugWorkarounds, |
| 811 base::IntToString(gpu::USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS)); | 811 base::IntToString(gpu::USE_CLIENT_SIDE_ARRAYS_FOR_STREAM_BUFFERS)); |
| 812 info_->AddFeatures(command_line); | 812 info_->AddFeatures(command_line); |
| 813 EXPECT_TRUE(info_->workarounds().use_client_side_arrays_for_stream_buffers); | 813 EXPECT_TRUE(info_->workarounds().use_client_side_arrays_for_stream_buffers); |
| 814 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); | 814 EXPECT_FALSE(info_->feature_flags().native_vertex_array_object); |
| 815 } | 815 } |
| 816 | 816 |
| 817 TEST_F(FeatureInfoTest, InitializeEXT_frag_depth) { |
| 818 SetupInitExpectations("GL_EXT_frag_depth"); |
| 819 info_->Initialize(NULL); |
| 820 EXPECT_TRUE(info_->feature_flags().ext_frag_depth); |
| 821 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_frag_depth")); |
| 822 } |
| 823 |
| 817 TEST_F(FeatureInfoTest, InitializeSamplersWithARBSamplerObjects) { | 824 TEST_F(FeatureInfoTest, InitializeSamplersWithARBSamplerObjects) { |
| 818 SetupInitExpectationsWithGLVersion("GL_ARB_sampler_objects", "OpenGL 3.0"); | 825 SetupInitExpectationsWithGLVersion("GL_ARB_sampler_objects", "OpenGL 3.0"); |
| 819 info_->Initialize(NULL); | 826 info_->Initialize(NULL); |
| 820 EXPECT_TRUE(info_->feature_flags().enable_samplers); | 827 EXPECT_TRUE(info_->feature_flags().enable_samplers); |
| 821 } | 828 } |
| 822 | 829 |
| 823 TEST_F(FeatureInfoTest, InitializeSamplersWithES3) { | 830 TEST_F(FeatureInfoTest, InitializeSamplersWithES3) { |
| 824 SetupInitExpectationsWithGLVersion("", "OpenGL ES 3.0"); | 831 SetupInitExpectationsWithGLVersion("", "OpenGL ES 3.0"); |
| 825 info_->Initialize(NULL); | 832 info_->Initialize(NULL); |
| 826 EXPECT_TRUE(info_->feature_flags().enable_samplers); | 833 EXPECT_TRUE(info_->feature_flags().enable_samplers); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 855 EXPECT_EQ(0, info_->workarounds().max_cube_map_texture_size); | 862 EXPECT_EQ(0, info_->workarounds().max_cube_map_texture_size); |
| 856 EXPECT_EQ(0, info_->workarounds().max_texture_size); | 863 EXPECT_EQ(0, info_->workarounds().max_texture_size); |
| 857 info_->AddFeatures(command_line); | 864 info_->AddFeatures(command_line); |
| 858 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); | 865 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); |
| 859 EXPECT_EQ(1024, info_->workarounds().max_cube_map_texture_size); | 866 EXPECT_EQ(1024, info_->workarounds().max_cube_map_texture_size); |
| 860 EXPECT_EQ(4096, info_->workarounds().max_texture_size); | 867 EXPECT_EQ(4096, info_->workarounds().max_texture_size); |
| 861 } | 868 } |
| 862 | 869 |
| 863 } // namespace gles2 | 870 } // namespace gles2 |
| 864 } // namespace gpu | 871 } // namespace gpu |
| OLD | NEW |