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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid( | 569 EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid( |
570 GL_RGB16F_EXT)); | 570 GL_RGB16F_EXT)); |
571 EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid( | 571 EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid( |
572 GL_ALPHA16F_EXT)); | 572 GL_ALPHA16F_EXT)); |
573 EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid( | 573 EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid( |
574 GL_LUMINANCE16F_EXT)); | 574 GL_LUMINANCE16F_EXT)); |
575 EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid( | 575 EXPECT_TRUE(info_->validators()->texture_internal_format_storage.IsValid( |
576 GL_LUMINANCE_ALPHA16F_EXT)); | 576 GL_LUMINANCE_ALPHA16F_EXT)); |
577 } | 577 } |
578 | 578 |
579 // Check how to handle ES, texture_storage and BGRA combination; 8 tests. | 579 // Check how to handle ES, texture_storage and BGRA combination; 10 tests. |
580 | 580 |
581 // 1- ES2 + GL_EXT_texture_storage -> GL_EXT_texture_storage (and no | 581 // 1- ES2 + GL_EXT_texture_storage -> GL_EXT_texture_storage (and no |
582 // GL_EXT_texture_format_BGRA8888 - we don't claim to handle GL_BGRA8 in | 582 // GL_EXT_texture_format_BGRA8888 - we don't claim to handle GL_BGRA8 in |
583 // glTexStorage2DEXT) | 583 // glTexStorage2DEXT) |
584 TEST_F(FeatureInfoTest, InitializeGLES2_texture_storage) { | 584 TEST_F(FeatureInfoTest, InitializeGLES2_texture_storage) { |
585 SetupInitExpectationsWithGLVersion( | 585 SetupInitExpectationsWithGLVersion( |
586 "GL_EXT_texture_storage", "", "OpenGL ES 2.0"); | 586 "GL_EXT_texture_storage", "", "OpenGL ES 2.0"); |
587 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage")); | 587 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage")); |
588 EXPECT_THAT(info_->extensions(), | 588 EXPECT_THAT(info_->extensions(), |
589 Not(HasSubstr("GL_EXT_texture_format_BGRA8888"))); | 589 Not(HasSubstr("GL_EXT_texture_format_BGRA8888"))); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 | 651 |
652 // 8- ES3 + none of the above -> GL_EXT_texture_storage (and no | 652 // 8- ES3 + none of the above -> GL_EXT_texture_storage (and no |
653 // GL_EXT_texture_format_BGRA8888 - we don't claim to handle GL_BGRA8) | 653 // GL_EXT_texture_format_BGRA8888 - we don't claim to handle GL_BGRA8) |
654 TEST_F(FeatureInfoTest, InitializeGLES3_texture_storage) { | 654 TEST_F(FeatureInfoTest, InitializeGLES3_texture_storage) { |
655 SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 3.0"); | 655 SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 3.0"); |
656 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage")); | 656 EXPECT_THAT(info_->extensions(), HasSubstr("GL_EXT_texture_storage")); |
657 EXPECT_THAT(info_->extensions(), | 657 EXPECT_THAT(info_->extensions(), |
658 Not(HasSubstr("GL_EXT_texture_format_BGRA8888"))); | 658 Not(HasSubstr("GL_EXT_texture_format_BGRA8888"))); |
659 } | 659 } |
660 | 660 |
| 661 // 9- ANGLE will add the GL_CHROMIUM_renderbuffer_format_BGRA8888 extension and |
| 662 // the GL_BGRA8_EXT render buffer format. |
| 663 TEST_F(FeatureInfoTest, InitializeWithANGLE_BGRA8) { |
| 664 SetupInitExpectationsWithGLVersion("", kGLRendererStringANGLE, ""); |
| 665 EXPECT_TRUE(info_->gl_version_info().is_angle); |
| 666 EXPECT_THAT(info_->extensions(), |
| 667 HasSubstr("GL_CHROMIUM_renderbuffer_format_BGRA8888")); |
| 668 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_BGRA8_EXT)); |
| 669 } |
| 670 |
| 671 // 10- vanilla opengl es means no GL_CHROMIUM_renderbuffer_format_BGRA8888 |
| 672 TEST_F(FeatureInfoTest, |
| 673 InitializeGLES2_no_CHROMIUM_renderbuffer_format_BGRA8888) { |
| 674 SetupInitExpectationsWithGLVersion("", "", "OpenGL ES 2.0"); |
| 675 EXPECT_THAT(info_->extensions(), |
| 676 Not(HasSubstr("GL_CHROMIUM_renderbuffer_format_BGRA8888"))); |
| 677 } |
| 678 |
661 TEST_F(FeatureInfoTest, InitializeARB_texture_float) { | 679 TEST_F(FeatureInfoTest, InitializeARB_texture_float) { |
662 SetupInitExpectations("GL_ARB_texture_float"); | 680 SetupInitExpectations("GL_ARB_texture_float"); |
663 EXPECT_TRUE(info_->feature_flags().chromium_color_buffer_float_rgba); | 681 EXPECT_TRUE(info_->feature_flags().chromium_color_buffer_float_rgba); |
664 EXPECT_TRUE(info_->feature_flags().chromium_color_buffer_float_rgb); | 682 EXPECT_TRUE(info_->feature_flags().chromium_color_buffer_float_rgb); |
665 std::string extensions = info_->extensions() + " "; | 683 std::string extensions = info_->extensions() + " "; |
666 EXPECT_THAT(extensions, HasSubstr("GL_CHROMIUM_color_buffer_float_rgb ")); | 684 EXPECT_THAT(extensions, HasSubstr("GL_CHROMIUM_color_buffer_float_rgb ")); |
667 EXPECT_THAT(extensions, HasSubstr("GL_CHROMIUM_color_buffer_float_rgba")); | 685 EXPECT_THAT(extensions, HasSubstr("GL_CHROMIUM_color_buffer_float_rgba")); |
668 EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid( | 686 EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid( |
669 GL_RGBA32F)); | 687 GL_RGBA32F)); |
670 EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid( | 688 EXPECT_TRUE(info_->validators()->texture_internal_format.IsValid( |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 EXPECT_FALSE( | 1489 EXPECT_FALSE( |
1472 info_->GetTextureFormatValidator(GL_RG_EXT).IsValid(GL_HALF_FLOAT_OES)); | 1490 info_->GetTextureFormatValidator(GL_RG_EXT).IsValid(GL_HALF_FLOAT_OES)); |
1473 EXPECT_TRUE( | 1491 EXPECT_TRUE( |
1474 info_->GetTextureFormatValidator(GL_RED_EXT).IsValid(GL_UNSIGNED_BYTE)); | 1492 info_->GetTextureFormatValidator(GL_RED_EXT).IsValid(GL_UNSIGNED_BYTE)); |
1475 EXPECT_TRUE( | 1493 EXPECT_TRUE( |
1476 info_->GetTextureFormatValidator(GL_RG_EXT).IsValid(GL_UNSIGNED_BYTE)); | 1494 info_->GetTextureFormatValidator(GL_RG_EXT).IsValid(GL_UNSIGNED_BYTE)); |
1477 } | 1495 } |
1478 | 1496 |
1479 } // namespace gles2 | 1497 } // namespace gles2 |
1480 } // namespace gpu | 1498 } // namespace gpu |
OLD | NEW |