| 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 #ifndef GL_GLEXT_PROTOTYPES | 5 #ifndef GL_GLEXT_PROTOTYPES |
| 6 #define GL_GLEXT_PROTOTYPES | 6 #define GL_GLEXT_PROTOTYPES |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 } | 766 } |
| 767 | 767 |
| 768 EXPECT_TRUE(GL_NO_ERROR == glGetError()) << "src_index:" << src_index | 768 EXPECT_TRUE(GL_NO_ERROR == glGetError()) << "src_index:" << src_index |
| 769 << " dest_index:" << dest_index; | 769 << " dest_index:" << dest_index; |
| 770 glDeleteTextures(2, textures_); | 770 glDeleteTextures(2, textures_); |
| 771 glDeleteFramebuffers(1, &framebuffer_id_); | 771 glDeleteFramebuffers(1, &framebuffer_id_); |
| 772 } | 772 } |
| 773 } | 773 } |
| 774 } | 774 } |
| 775 | 775 |
| 776 TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatRGBFloat) { |
| 777 if (!GLTestHelper::HasExtension("GL_CHROMIUM_color_buffer_float_rgb")) { |
| 778 LOG(INFO) |
| 779 << "GL_CHROMIUM_color_buffer_float_rgb not supported. Skipping test..."; |
| 780 return; |
| 781 } |
| 782 // TODO(qiankun.miao@intel.com): since RunCopyTexture requires dest texture to |
| 783 // be texture complete, skip this test if float texture is not color |
| 784 // filterable. We should remove this limitation when we find a way doesn't |
| 785 // require dest texture to be texture complete in RunCopyTexture. |
| 786 if (!gl_.decoder() |
| 787 ->GetFeatureInfo() |
| 788 ->feature_flags() |
| 789 .enable_texture_float_linear) { |
| 790 LOG(INFO) << "RGB32F texture is not filterable. Skipping test..."; |
| 791 return; |
| 792 } |
| 793 CopyType copy_type = GetParam(); |
| 794 FormatType src_format_type = {GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE}; |
| 795 FormatType dest_format_type = {GL_RGB32F, GL_RGB, GL_FLOAT}; |
| 796 |
| 797 RunCopyTexture(GL_TEXTURE_2D, copy_type, src_format_type, 0, dest_format_type, |
| 798 0, false); |
| 799 } |
| 800 |
| 801 TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatRGBAFloat) { |
| 802 if (!GLTestHelper::HasExtension("GL_CHROMIUM_color_buffer_float_rgba")) { |
| 803 LOG(INFO) << "GL_CHROMIUM_color_buffer_float_rgba not supported. Skipping " |
| 804 "test..."; |
| 805 return; |
| 806 } |
| 807 // TODO(qiankun.miao@intel.com): since RunCopyTexture requires dest texture to |
| 808 // be texture complete, skip this test if float texture is not color |
| 809 // filterable. We should remove this limitation when we find a way doesn't |
| 810 // require dest texture to be texture complete in RunCopyTexture. |
| 811 if (!gl_.decoder() |
| 812 ->GetFeatureInfo() |
| 813 ->feature_flags() |
| 814 .enable_texture_float_linear) { |
| 815 LOG(INFO) << "RGBA32F texture is not filterable. Skipping test..."; |
| 816 return; |
| 817 } |
| 818 CopyType copy_type = GetParam(); |
| 819 FormatType src_format_type = {GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE}; |
| 820 FormatType dest_format_type = {GL_RGBA32F, GL_RGBA, GL_FLOAT}; |
| 821 |
| 822 RunCopyTexture(GL_TEXTURE_2D, copy_type, src_format_type, 0, dest_format_type, |
| 823 0, false); |
| 824 } |
| 825 |
| 776 TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) { | 826 TEST_P(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) { |
| 777 CopyType copy_type = GetParam(); | 827 CopyType copy_type = GetParam(); |
| 778 CreateAndBindDestinationTextureAndFBO(GL_TEXTURE_2D); | 828 CreateAndBindDestinationTextureAndFBO(GL_TEXTURE_2D); |
| 779 glBindTexture(GL_TEXTURE_2D, textures_[0]); | 829 glBindTexture(GL_TEXTURE_2D, textures_[0]); |
| 780 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 830 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
| 781 nullptr); | 831 nullptr); |
| 782 EXPECT_TRUE(GL_NO_ERROR == glGetError()); | 832 EXPECT_TRUE(GL_NO_ERROR == glGetError()); |
| 783 | 833 |
| 784 // Check unsupported format reports error. | 834 // Check unsupported format reports error. |
| 785 GLint unsupported_dest_formats[] = {GL_RED, GL_RG}; | 835 GLint unsupported_dest_formats[] = {GL_RED, GL_RG}; |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1586 } | 1636 } |
| 1587 } | 1637 } |
| 1588 | 1638 |
| 1589 glDeleteTextures(2, textures_); | 1639 glDeleteTextures(2, textures_); |
| 1590 glDeleteFramebuffers(1, &framebuffer_id_); | 1640 glDeleteFramebuffers(1, &framebuffer_id_); |
| 1591 } | 1641 } |
| 1592 } | 1642 } |
| 1593 } | 1643 } |
| 1594 | 1644 |
| 1595 } // namespace gpu | 1645 } // namespace gpu |
| OLD | NEW |