| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 EXPECT_FALSE(info_->feature_flags().ext_draw_buffers); | 212 EXPECT_FALSE(info_->feature_flags().ext_draw_buffers); |
| 213 EXPECT_FALSE(info_->feature_flags().nv_draw_buffers); | 213 EXPECT_FALSE(info_->feature_flags().nv_draw_buffers); |
| 214 EXPECT_FALSE(info_->feature_flags().ext_discard_framebuffer); | 214 EXPECT_FALSE(info_->feature_flags().ext_discard_framebuffer); |
| 215 EXPECT_FALSE(info_->feature_flags().angle_depth_texture); | 215 EXPECT_FALSE(info_->feature_flags().angle_depth_texture); |
| 216 EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra); | 216 EXPECT_FALSE(info_->feature_flags().ext_read_format_bgra); |
| 217 | 217 |
| 218 #define GPU_OP(type, name) EXPECT_FALSE(info_->workarounds().name); | 218 #define GPU_OP(type, name) EXPECT_FALSE(info_->workarounds().name); |
| 219 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 219 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 220 #undef GPU_OP | 220 #undef GPU_OP |
| 221 EXPECT_EQ(0, info_->workarounds().max_texture_size); | 221 EXPECT_EQ(0, info_->workarounds().max_texture_size); |
| 222 EXPECT_EQ(0, info_->workarounds().max_cube_map_texture_size); | |
| 223 EXPECT_FALSE(info_->workarounds().gl_clear_broken); | 222 EXPECT_FALSE(info_->workarounds().gl_clear_broken); |
| 224 } | 223 } |
| 225 | 224 |
| 226 TEST_P(FeatureInfoTest, InitializeNoExtensions) { | 225 TEST_P(FeatureInfoTest, InitializeNoExtensions) { |
| 227 SetupInitExpectations(""); | 226 SetupInitExpectations(""); |
| 228 // Check default extensions are there | 227 // Check default extensions are there |
| 229 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_resource_safe")); | 228 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_resource_safe")); |
| 230 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_strict_attribs")); | 229 EXPECT_THAT(info_->extensions(), HasSubstr("GL_CHROMIUM_strict_attribs")); |
| 231 EXPECT_THAT(info_->extensions(), | 230 EXPECT_THAT(info_->extensions(), |
| 232 HasSubstr("GL_ANGLE_translated_shader_source")); | 231 HasSubstr("GL_ANGLE_translated_shader_source")); |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 // Workarounds should get parsed without the need for a context. | 1327 // Workarounds should get parsed without the need for a context. |
| 1329 SetupWithCommandLine(command_line); | 1328 SetupWithCommandLine(command_line); |
| 1330 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); | 1329 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); |
| 1331 } | 1330 } |
| 1332 | 1331 |
| 1333 TEST_P(FeatureInfoTest, ParseDriverBugWorkaroundsMultiple) { | 1332 TEST_P(FeatureInfoTest, ParseDriverBugWorkaroundsMultiple) { |
| 1334 base::CommandLine command_line(0, NULL); | 1333 base::CommandLine command_line(0, NULL); |
| 1335 command_line.AppendSwitchASCII( | 1334 command_line.AppendSwitchASCII( |
| 1336 switches::kGpuDriverBugWorkarounds, | 1335 switches::kGpuDriverBugWorkarounds, |
| 1337 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST) + "," + | 1336 base::IntToString(gpu::EXIT_ON_CONTEXT_LOST) + "," + |
| 1338 base::IntToString(gpu::MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024) + "," + | |
| 1339 base::IntToString(gpu::MAX_TEXTURE_SIZE_LIMIT_4096)); | 1337 base::IntToString(gpu::MAX_TEXTURE_SIZE_LIMIT_4096)); |
| 1340 // Workarounds should get parsed without the need for a context. | 1338 // Workarounds should get parsed without the need for a context. |
| 1341 SetupWithCommandLine(command_line); | 1339 SetupWithCommandLine(command_line); |
| 1342 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); | 1340 EXPECT_TRUE(info_->workarounds().exit_on_context_lost); |
| 1343 EXPECT_EQ(1024, info_->workarounds().max_cube_map_texture_size); | |
| 1344 EXPECT_EQ(4096, info_->workarounds().max_texture_size); | 1341 EXPECT_EQ(4096, info_->workarounds().max_texture_size); |
| 1345 } | 1342 } |
| 1346 | 1343 |
| 1347 TEST_P(FeatureInfoTest, InitializeWithARBSync) { | 1344 TEST_P(FeatureInfoTest, InitializeWithARBSync) { |
| 1348 SetupInitExpectations("GL_ARB_sync"); | 1345 SetupInitExpectations("GL_ARB_sync"); |
| 1349 EXPECT_TRUE(info_->feature_flags().chromium_sync_query); | 1346 EXPECT_TRUE(info_->feature_flags().chromium_sync_query); |
| 1350 EXPECT_TRUE(gl::GLFence::IsSupported()); | 1347 EXPECT_TRUE(gl::GLFence::IsSupported()); |
| 1351 } | 1348 } |
| 1352 | 1349 |
| 1353 TEST_P(FeatureInfoTest, InitializeWithNVFence) { | 1350 TEST_P(FeatureInfoTest, InitializeWithNVFence) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT)); | 1488 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT)); |
| 1492 } | 1489 } |
| 1493 | 1490 |
| 1494 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) { | 1491 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) { |
| 1495 SetupInitExpectations("GL_APPLE_ycbcr_422"); | 1492 SetupInitExpectations("GL_APPLE_ycbcr_422"); |
| 1496 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422); | 1493 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422); |
| 1497 } | 1494 } |
| 1498 | 1495 |
| 1499 } // namespace gles2 | 1496 } // namespace gles2 |
| 1500 } // namespace gpu | 1497 } // namespace gpu |
| OLD | NEW |