| 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 #include <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
| 6 #include <GLES2/gl2ext.h> | 6 #include <GLES2/gl2ext.h> |
| 7 | 7 |
| 8 #include "gpu/command_buffer/tests/gl_manager.h" | 8 #include "gpu/command_buffer/tests/gl_manager.h" |
| 9 #include "gpu/command_buffer/tests/gl_test_utils.h" | 9 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 namespace gpu { | 12 namespace gpu { |
| 13 | 13 |
| 14 // A collection of tests that exercise the GL_EXT_srgb extension. | 14 // A collection of tests that exercise the GL_EXT_srgb extension. |
| 15 class GLEXTSRGBTest : public testing::Test { | 15 class GLEXTSRGBTest : public testing::Test { |
| 16 protected: | 16 protected: |
| 17 void SetUp() override { gl_.Initialize(GLManager::Options()); } | 17 void SetUp() override { gl_.Initialize(GLManager::Options()); } |
| 18 void TearDown() override { gl_.Destroy(); } | 18 void TearDown() override { gl_.Destroy(); } |
| 19 bool IsApplicable() const { | 19 bool IsApplicable() const { |
| 20 return GLTestHelper::HasExtension("GL_EXT_sRGB"); | 20 return GLTestHelper::HasExtension("GL_EXT_sRGB"); |
| 21 } | 21 } |
| 22 GLManager gl_; | 22 GLManager gl_; |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 // Test to ensure that GL_SRGB_ALPHA as glTex(Sub)Image2D parameter works. This | 25 // Test to ensure that GL_SRGB_ALPHA as glTex(Sub)Image2D parameter works. This |
| 26 // is tricky because GL_SRGB_ALPHA is valid in OpenGL ES 2.0 but not valid in | 26 // is tricky because GL_SRGB_ALPHA is valid in OpenGL ES 2.0 but not valid in |
| 27 // OpenGL. | 27 // OpenGL. |
| 28 TEST_F(GLEXTSRGBTest, TexImageSRGBALPHAFormat) { | 28 #if defined(OS_ANDROID) |
| 29 // Test is failing for Lollipop 64 bit Tester. |
| 30 // See crbug/550292. |
| 31 #define MAYBE_TexImageSRGBALPHAFormat DISABLED_TexImageSRGBALPHAFormat |
| 32 #else |
| 33 #define MAYBE_TexImageSRGBALPHAFormat TexImageSRGBALPHAFormat |
| 34 #endif |
| 35 TEST_F(GLEXTSRGBTest, MAYBE_TexImageSRGBALPHAFormat) { |
| 29 if (!IsApplicable()) | 36 if (!IsApplicable()) |
| 30 return; | 37 return; |
| 31 static const int kWidth = 10; | 38 static const int kWidth = 10; |
| 32 static const int kHeight = 10; | 39 static const int kHeight = 10; |
| 33 static const int kSubImageX = kWidth / 2; | 40 static const int kSubImageX = kWidth / 2; |
| 34 static const int kSubImageY = kHeight / 2; | 41 static const int kSubImageY = kHeight / 2; |
| 35 static const int kSubImageWidth = kWidth / 2; | 42 static const int kSubImageWidth = kWidth / 2; |
| 36 static const int kSubImageHeight = kHeight / 2; | 43 static const int kSubImageHeight = kHeight / 2; |
| 37 static const uint8 kImageColor[] = {255, 255, 255, 255}; | 44 static const uint8 kImageColor[] = {255, 255, 255, 255}; |
| 38 static const uint8 kSubImageColor[] = {128, 128, 128, 128}; | 45 static const uint8 kSubImageColor[] = {128, 128, 128, 128}; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 65 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE), | 72 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE), |
| 66 glCheckFramebufferStatus(GL_FRAMEBUFFER)); | 73 glCheckFramebufferStatus(GL_FRAMEBUFFER)); |
| 67 | 74 |
| 68 GLTestHelper::CheckPixels(0, 0, kSubImageX, kHeight, 0, kImageColor); | 75 GLTestHelper::CheckPixels(0, 0, kSubImageX, kHeight, 0, kImageColor); |
| 69 GLTestHelper::CheckPixels(0, 0, kWidth, kSubImageY, 0, kImageColor); | 76 GLTestHelper::CheckPixels(0, 0, kWidth, kSubImageY, 0, kImageColor); |
| 70 GLTestHelper::CheckPixels(kSubImageX, kSubImageY, kSubImageWidth, | 77 GLTestHelper::CheckPixels(kSubImageX, kSubImageY, kSubImageWidth, |
| 71 kSubImageHeight, 0, kSubImageColor); | 78 kSubImageHeight, 0, kSubImageColor); |
| 72 } | 79 } |
| 73 | 80 |
| 74 } // namespace gpu | 81 } // namespace gpu |
| OLD | NEW |