| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 glCompressedCopyTextureCHROMIUM(99994, textures_[1]); | 268 glCompressedCopyTextureCHROMIUM(99994, textures_[1]); |
| 269 EXPECT_TRUE(glGetError() == GL_INVALID_VALUE); | 269 EXPECT_TRUE(glGetError() == GL_INVALID_VALUE); |
| 270 | 270 |
| 271 glCompressedCopyTextureCHROMIUM(99995, 99996); | 271 glCompressedCopyTextureCHROMIUM(99995, 99996); |
| 272 EXPECT_TRUE(glGetError() == GL_INVALID_VALUE); | 272 EXPECT_TRUE(glGetError() == GL_INVALID_VALUE); |
| 273 | 273 |
| 274 glCompressedCopyTextureCHROMIUM(textures_[0], textures_[1]); | 274 glCompressedCopyTextureCHROMIUM(textures_[0], textures_[1]); |
| 275 EXPECT_TRUE(glGetError() == GL_NO_ERROR); | 275 EXPECT_TRUE(glGetError() == GL_NO_ERROR); |
| 276 } | 276 } |
| 277 | 277 |
| 278 TEST_F(GLCompressedCopyTextureCHROMIUMTest, InvalidTextureTarget) { |
| 279 glBindTexture(GL_TEXTURE_CUBE_MAP, textures_[0]); |
| 280 glBindTexture(GL_TEXTURE_CUBE_MAP, textures_[1]); |
| 281 glCompressedCopyTextureCHROMIUM(textures_[0], textures_[1]); |
| 282 EXPECT_TRUE(glGetError() == GL_INVALID_VALUE); |
| 283 } |
| 284 |
| 278 // Validate that some basic GL state is not touched upon execution of | 285 // Validate that some basic GL state is not touched upon execution of |
| 279 // the extension. | 286 // the extension. |
| 280 TEST_F(GLCompressedCopyTextureCHROMIUMTest, BasicStatePreservation) { | 287 TEST_F(GLCompressedCopyTextureCHROMIUMTest, BasicStatePreservation) { |
| 281 if (!GLTestHelper::HasExtension("GL_EXT_texture_compression_dxt1")) { | 288 if (!GLTestHelper::HasExtension("GL_EXT_texture_compression_dxt1")) { |
| 282 LOG(INFO) << | 289 LOG(INFO) << |
| 283 "GL_EXT_texture_compression_dxt1 not supported. Skipping test..."; | 290 "GL_EXT_texture_compression_dxt1 not supported. Skipping test..."; |
| 284 return; | 291 return; |
| 285 } | 292 } |
| 286 | 293 |
| 287 glBindTexture(GL_TEXTURE_2D, textures_[0]); | 294 glBindTexture(GL_TEXTURE_2D, textures_[0]); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound_texture); | 398 glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound_texture); |
| 392 EXPECT_EQ(texture_ids[0], static_cast<GLuint>(bound_texture)); | 399 EXPECT_EQ(texture_ids[0], static_cast<GLuint>(bound_texture)); |
| 393 glBindTexture(GL_TEXTURE_2D, 0); | 400 glBindTexture(GL_TEXTURE_2D, 0); |
| 394 | 401 |
| 395 glDeleteTextures(2, texture_ids); | 402 glDeleteTextures(2, texture_ids); |
| 396 | 403 |
| 397 EXPECT_TRUE(GL_NO_ERROR == glGetError()); | 404 EXPECT_TRUE(GL_NO_ERROR == glGetError()); |
| 398 } | 405 } |
| 399 | 406 |
| 400 } // namespace gpu | 407 } // namespace gpu |
| OLD | NEW |