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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 | 110 |
111 TEST_F(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) { | 111 TEST_F(GLCopyTextureCHROMIUMTest, InternalFormatNotSupported) { |
112 glBindTexture(GL_TEXTURE_2D, textures_[0]); | 112 glBindTexture(GL_TEXTURE_2D, textures_[0]); |
113 glTexImage2D( | 113 glTexImage2D( |
114 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); | 114 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); |
115 EXPECT_TRUE(GL_NO_ERROR == glGetError()); | 115 EXPECT_TRUE(GL_NO_ERROR == glGetError()); |
116 | 116 |
117 // Check unsupported format reports error. | 117 // Check unsupported format reports error. |
118 GLint unsupported_dest_formats[] = {GL_ALPHA, GL_LUMINANCE, | 118 GLint unsupported_dest_formats[] = {GL_ALPHA, GL_LUMINANCE, |
119 GL_LUMINANCE_ALPHA, GL_BGRA_EXT}; | 119 GL_LUMINANCE_ALPHA}; |
120 for (size_t dest_index = 0; dest_index < arraysize(unsupported_dest_formats); | 120 for (size_t dest_index = 0; dest_index < arraysize(unsupported_dest_formats); |
121 dest_index++) { | 121 dest_index++) { |
122 glCopyTextureCHROMIUM(GL_TEXTURE_2D, | 122 glCopyTextureCHROMIUM(GL_TEXTURE_2D, |
123 textures_[0], | 123 textures_[0], |
124 textures_[1], | 124 textures_[1], |
125 0, | 125 0, |
126 unsupported_dest_formats[dest_index], | 126 unsupported_dest_formats[dest_index], |
127 GL_UNSIGNED_BYTE); | 127 GL_UNSIGNED_BYTE); |
128 EXPECT_TRUE(GL_INVALID_OPERATION == glGetError()) | 128 EXPECT_TRUE(GL_INVALID_OPERATION == glGetError()) |
129 << "dest_index:" << dest_index; | 129 << "dest_index:" << dest_index; |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 EXPECT_EQ(0, pixels[y][x][1]); | 623 EXPECT_EQ(0, pixels[y][x][1]); |
624 EXPECT_EQ(0, pixels[y][x][2]); | 624 EXPECT_EQ(0, pixels[y][x][2]); |
625 EXPECT_EQ(0, pixels[y][x][3]); | 625 EXPECT_EQ(0, pixels[y][x][3]); |
626 } | 626 } |
627 } | 627 } |
628 | 628 |
629 EXPECT_TRUE(GL_NO_ERROR == glGetError()); | 629 EXPECT_TRUE(GL_NO_ERROR == glGetError()); |
630 } | 630 } |
631 | 631 |
632 } // namespace gpu | 632 } // namespace gpu |
OLD | NEW |