| 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_service_test.h" | 10 #include "gpu/command_buffer/service/gpu_service_test.h" |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 } | 1163 } |
| 1164 | 1164 |
| 1165 TEST_F(FeatureInfoTest, InitializeSamplersWithARBSamplerObjects) { | 1165 TEST_F(FeatureInfoTest, InitializeSamplersWithARBSamplerObjects) { |
| 1166 SetupInitExpectationsWithGLVersion( | 1166 SetupInitExpectationsWithGLVersion( |
| 1167 "GL_ARB_sampler_objects", "", "OpenGL 3.0"); | 1167 "GL_ARB_sampler_objects", "", "OpenGL 3.0"); |
| 1168 EXPECT_TRUE(info_->feature_flags().enable_samplers); | 1168 EXPECT_TRUE(info_->feature_flags().enable_samplers); |
| 1169 } | 1169 } |
| 1170 | 1170 |
| 1171 TEST_F(FeatureInfoTest, InitializeWithES3) { | 1171 TEST_F(FeatureInfoTest, InitializeWithES3) { |
| 1172 SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 3.0"); | 1172 SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 3.0"); |
| 1173 EXPECT_TRUE(info_->feature_flags().enable_samplers); | |
| 1174 EXPECT_TRUE(info_->feature_flags().map_buffer_range); | |
| 1175 EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer); | |
| 1176 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_discard_framebuffer")); | |
| 1177 EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample); | 1173 EXPECT_TRUE(info_->feature_flags().chromium_framebuffer_multisample); |
| 1178 EXPECT_TRUE(info_->feature_flags().use_core_framebuffer_multisample); | 1174 EXPECT_TRUE(info_->feature_flags().use_core_framebuffer_multisample); |
| 1179 EXPECT_THAT(info_->extensions(), | 1175 EXPECT_THAT(info_->extensions(), |
| 1180 HasSubstr("GL_CHROMIUM_framebuffer_multisample")); | 1176 HasSubstr("GL_CHROMIUM_framebuffer_multisample")); |
| 1181 EXPECT_TRUE(info_->feature_flags().use_async_readpixels); | 1177 EXPECT_TRUE(info_->feature_flags().use_async_readpixels); |
| 1178 EXPECT_TRUE(info_->feature_flags().oes_standard_derivatives); |
| 1182 EXPECT_TRUE(info_->feature_flags().oes_depth24); | 1179 EXPECT_TRUE(info_->feature_flags().oes_depth24); |
| 1183 EXPECT_THAT(info_->extensions(), HasSubstr("GL_GOOGLE_depth_texture")); | 1180 EXPECT_THAT(info_->extensions(), HasSubstr("GL_GOOGLE_depth_texture")); |
| 1184 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_depth_texture")); | 1181 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_depth_texture")); |
| 1182 EXPECT_TRUE( |
| 1183 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_COMPONENT)); |
| 1184 EXPECT_TRUE( |
| 1185 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL)); |
| 1186 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_COMPONENT)); |
| 1187 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL)); |
| 1188 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_SHORT)); |
| 1189 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT)); |
| 1185 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8)); | 1190 EXPECT_TRUE(info_->validators()->pixel_type.IsValid(GL_UNSIGNED_INT_24_8)); |
| 1186 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT) | 1191 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT) |
| 1187 .IsValid(GL_UNSIGNED_SHORT)); | 1192 .IsValid(GL_UNSIGNED_SHORT)); |
| 1188 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT) | 1193 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_COMPONENT) |
| 1189 .IsValid(GL_UNSIGNED_INT)); | 1194 .IsValid(GL_UNSIGNED_INT)); |
| 1190 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_STENCIL) | 1195 EXPECT_TRUE(info_->GetTextureFormatValidator(GL_DEPTH_STENCIL) |
| 1191 .IsValid(GL_UNSIGNED_INT_24_8)); | 1196 .IsValid(GL_UNSIGNED_INT_24_8)); |
| 1192 EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8); | 1197 EXPECT_TRUE(info_->feature_flags().packed_depth24_stencil8); |
| 1193 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_depth24")); | 1198 EXPECT_THAT(info_->extensions(), HasSubstr("GL_OES_depth24")); |
| 1194 EXPECT_TRUE( | 1199 EXPECT_TRUE( |
| 1195 info_->validators()->render_buffer_format.IsValid(GL_DEPTH_COMPONENT24)); | 1200 info_->validators()->render_buffer_format.IsValid(GL_DEPTH_COMPONENT24)); |
| 1196 EXPECT_TRUE( | 1201 EXPECT_TRUE( |
| 1197 info_->validators()->render_buffer_format.IsValid(GL_DEPTH24_STENCIL8)); | 1202 info_->validators()->render_buffer_format.IsValid(GL_DEPTH24_STENCIL8)); |
| 1198 EXPECT_TRUE( | 1203 EXPECT_TRUE( |
| 1199 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL)); | 1204 info_->validators()->texture_internal_format.IsValid(GL_DEPTH_STENCIL)); |
| 1200 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL)); | 1205 EXPECT_TRUE(info_->validators()->texture_format.IsValid(GL_DEPTH_STENCIL)); |
| 1206 EXPECT_TRUE(info_->feature_flags().npot_ok); |
| 1207 EXPECT_TRUE(info_->feature_flags().native_vertex_array_object); |
| 1208 EXPECT_TRUE(info_->feature_flags().enable_samplers); |
| 1209 EXPECT_TRUE(info_->feature_flags().map_buffer_range); |
| 1210 EXPECT_TRUE(info_->feature_flags().ext_discard_framebuffer); |
| 1211 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_discard_framebuffer")); |
| 1201 EXPECT_TRUE(info_->feature_flags().chromium_sync_query); | 1212 EXPECT_TRUE(info_->feature_flags().chromium_sync_query); |
| 1202 EXPECT_TRUE(gfx::GLFence::IsSupported()); | 1213 EXPECT_TRUE(gfx::GLFence::IsSupported()); |
| 1203 } | 1214 } |
| 1204 | 1215 |
| 1205 TEST_F(FeatureInfoTest, InitializeWithoutSamplers) { | 1216 TEST_F(FeatureInfoTest, InitializeWithoutSamplers) { |
| 1206 SetupInitExpectationsWithGLVersion("", "", "OpenGL GL 3.0"); | 1217 SetupInitExpectationsWithGLVersion("", "", "OpenGL GL 3.0"); |
| 1207 EXPECT_FALSE(info_->feature_flags().enable_samplers); | 1218 EXPECT_FALSE(info_->feature_flags().enable_samplers); |
| 1208 } | 1219 } |
| 1209 | 1220 |
| 1210 TEST_F(FeatureInfoTest, ParseDriverBugWorkaroundsSingle) { | 1221 TEST_F(FeatureInfoTest, ParseDriverBugWorkaroundsSingle) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 | 1287 |
| 1277 TEST_F(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering2) { | 1288 TEST_F(FeatureInfoTest, InitializeNoCHROMIUM_path_rendering2) { |
| 1278 SetupInitExpectationsWithGLVersion("GL_NV_path_rendering", "", "4.3"); | 1289 SetupInitExpectationsWithGLVersion("GL_NV_path_rendering", "", "4.3"); |
| 1279 EXPECT_FALSE(info_->feature_flags().chromium_path_rendering); | 1290 EXPECT_FALSE(info_->feature_flags().chromium_path_rendering); |
| 1280 EXPECT_THAT(info_->extensions(), | 1291 EXPECT_THAT(info_->extensions(), |
| 1281 Not(HasSubstr("GL_CHROMIUM_path_rendering"))); | 1292 Not(HasSubstr("GL_CHROMIUM_path_rendering"))); |
| 1282 } | 1293 } |
| 1283 | 1294 |
| 1284 } // namespace gles2 | 1295 } // namespace gles2 |
| 1285 } // namespace gpu | 1296 } // namespace gpu |
| OLD | NEW |