OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 // Load texture. | 145 // Load texture. |
146 glActiveTexture(GL_TEXTURE0); | 146 glActiveTexture(GL_TEXTURE0); |
147 glBindTexture(GL_TEXTURE_2D, textures_[1]); | 147 glBindTexture(GL_TEXTURE_2D, textures_[1]); |
148 glUniform1i(texture_loc, 0); | 148 glUniform1i(texture_loc, 0); |
149 | 149 |
150 // Draw. | 150 // Draw. |
151 glDrawArrays(GL_TRIANGLES, 0, 6); | 151 glDrawArrays(GL_TRIANGLES, 0, 6); |
152 glFlush(); | 152 glFlush(); |
153 | 153 |
154 GLTestHelper::CheckPixels(0, 0, 4, 4, 0, kCompressedImageColor); | 154 GLTestHelper::CheckPixels(0, 0, 4, 4, 0, kCompressedImageColor, nullptr); |
155 EXPECT_TRUE(GL_NO_ERROR == glGetError()); | 155 EXPECT_TRUE(GL_NO_ERROR == glGetError()); |
156 } | 156 } |
157 | 157 |
158 TEST_F(GLCompressedCopyTextureCHROMIUMTest, InternalFormat) { | 158 TEST_F(GLCompressedCopyTextureCHROMIUMTest, InternalFormat) { |
159 struct Image { | 159 struct Image { |
160 const GLint format; | 160 const GLint format; |
161 const uint8_t* data; | 161 const uint8_t* data; |
162 const GLsizei data_size; | 162 const GLsizei data_size; |
163 | 163 |
164 Image(const GLint format, const uint8_t* data, const GLsizei data_size) | 164 Image(const GLint format, const uint8_t* data, const GLsizei data_size) |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound_texture); | 398 glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound_texture); |
399 EXPECT_EQ(texture_ids[0], static_cast<GLuint>(bound_texture)); | 399 EXPECT_EQ(texture_ids[0], static_cast<GLuint>(bound_texture)); |
400 glBindTexture(GL_TEXTURE_2D, 0); | 400 glBindTexture(GL_TEXTURE_2D, 0); |
401 | 401 |
402 glDeleteTextures(2, texture_ids); | 402 glDeleteTextures(2, texture_ids); |
403 | 403 |
404 EXPECT_TRUE(GL_NO_ERROR == glGetError()); | 404 EXPECT_TRUE(GL_NO_ERROR == glGetError()); |
405 } | 405 } |
406 | 406 |
407 } // namespace gpu | 407 } // namespace gpu |
OLD | NEW |