| 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> |
| 11 #include <GLES2/gl2extchromium.h> | 11 #include <GLES2/gl2extchromium.h> |
| 12 | 12 |
| 13 #include "gpu/command_buffer/tests/gl_manager.h" | 13 #include "gpu/command_buffer/tests/gl_manager.h" |
| 14 #include "gpu/command_buffer/tests/gl_test_utils.h" | 14 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 namespace gpu { | 18 namespace gpu { |
| 19 | 19 |
| 20 // A collection of tests that exercise the GL_CHROMIUM_copy_texture extension. | 20 // A collection of tests that exercise the GL_CHROMIUM_copy_texture extension. |
| 21 class GLCopyTextureCHROMIUMTest : public testing::Test { | 21 class GLCopyTextureCHROMIUMTest : public testing::Test { |
| 22 protected: | 22 protected: |
| 23 virtual void SetUp() { | 23 void SetUp() override { |
| 24 gl_.Initialize(GLManager::Options()); | 24 gl_.Initialize(GLManager::Options()); |
| 25 | 25 |
| 26 glGenTextures(2, textures_); | 26 glGenTextures(2, textures_); |
| 27 glBindTexture(GL_TEXTURE_2D, textures_[1]); | 27 glBindTexture(GL_TEXTURE_2D, textures_[1]); |
| 28 | 28 |
| 29 // Some drivers (NVidia/SGX) require texture settings to be a certain way or | 29 // Some drivers (NVidia/SGX) require texture settings to be a certain way or |
| 30 // they won't report FRAMEBUFFER_COMPLETE. | 30 // they won't report FRAMEBUFFER_COMPLETE. |
| 31 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 31 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| 32 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 32 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 33 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | 33 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 34 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | 34 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); |
| 35 | 35 |
| 36 glGenFramebuffers(1, &framebuffer_id_); | 36 glGenFramebuffers(1, &framebuffer_id_); |
| 37 glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_id_); | 37 glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_id_); |
| 38 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, | 38 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, |
| 39 textures_[1], 0); | 39 textures_[1], 0); |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual void TearDown() { | 42 void TearDown() override { |
| 43 glDeleteTextures(2, textures_); | 43 glDeleteTextures(2, textures_); |
| 44 glDeleteFramebuffers(1, &framebuffer_id_); | 44 glDeleteFramebuffers(1, &framebuffer_id_); |
| 45 gl_.Destroy(); | 45 gl_.Destroy(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 GLManager gl_; | 48 GLManager gl_; |
| 49 GLuint textures_[2]; | 49 GLuint textures_[2]; |
| 50 GLuint framebuffer_id_; | 50 GLuint framebuffer_id_; |
| 51 }; | 51 }; |
| 52 | 52 |
| (...skipping 570 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 |