Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: gpu/command_buffer/tests/gl_copy_texture_CHROMIUM_unittest.cc

Issue 539703002: gpu: Make CopyTexture work with GL_BGRA_EXT destination textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update unit test Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698