| 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 #include <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
| 6 #include <GLES2/gl2ext.h> | 6 #include <GLES2/gl2ext.h> |
| 7 #include <GLES2/gl2extchromium.h> | 7 #include <GLES2/gl2extchromium.h> |
| 8 | 8 |
| 9 #include "gpu/command_buffer/tests/gl_manager.h" | 9 #include "gpu/command_buffer/tests/gl_manager.h" |
| 10 #include "gpu/command_buffer/tests/gl_test_utils.h" | 10 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace gpu { | 14 namespace gpu { |
| 15 | 15 |
| 16 class GLChromiumFramebufferMultisampleTest : public testing::Test { | 16 class GLChromiumFramebufferMultisampleTest : public testing::Test { |
| 17 protected: | 17 protected: |
| 18 virtual void SetUp() { | 18 void SetUp() override { gl_.Initialize(GLManager::Options()); } |
| 19 gl_.Initialize(GLManager::Options()); | |
| 20 } | |
| 21 | 19 |
| 22 virtual void TearDown() { | 20 void TearDown() override { gl_.Destroy(); } |
| 23 gl_.Destroy(); | |
| 24 } | |
| 25 | 21 |
| 26 GLManager gl_; | 22 GLManager gl_; |
| 27 }; | 23 }; |
| 28 | 24 |
| 29 // Test that GL is at least minimally working. | 25 // Test that GL is at least minimally working. |
| 30 TEST_F(GLChromiumFramebufferMultisampleTest, CachedBindingsTest) { | 26 TEST_F(GLChromiumFramebufferMultisampleTest, CachedBindingsTest) { |
| 31 if (!GLTestHelper::HasExtension("GL_CHROMIUM_framebuffer_multisample")) { | 27 if (!GLTestHelper::HasExtension("GL_CHROMIUM_framebuffer_multisample")) { |
| 32 return; | 28 return; |
| 33 } | 29 } |
| 34 | 30 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 const uint8 green[] = {0, 255, 0, 255}; | 148 const uint8 green[] = {0, 255, 0, 255}; |
| 153 const uint8 black[] = {0, 0, 0, 0}; | 149 const uint8 black[] = {0, 0, 0, 0}; |
| 154 glBindFramebuffer(GL_READ_FRAMEBUFFER, resolve_fbo); | 150 glBindFramebuffer(GL_READ_FRAMEBUFFER, resolve_fbo); |
| 155 EXPECT_TRUE( | 151 EXPECT_TRUE( |
| 156 GLTestHelper::CheckPixels(width / 4, (3 * height) / 4, 1, 1, 0, green)); | 152 GLTestHelper::CheckPixels(width / 4, (3 * height) / 4, 1, 1, 0, green)); |
| 157 EXPECT_TRUE(GLTestHelper::CheckPixels(width - 1, 0, 1, 1, 0, black)); | 153 EXPECT_TRUE(GLTestHelper::CheckPixels(width - 1, 0, 1, 1, 0, black)); |
| 158 } | 154 } |
| 159 | 155 |
| 160 } // namespace gpu | 156 } // namespace gpu |
| 161 | 157 |
| OLD | NEW |