| 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 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "gpu/command_buffer/tests/gl_manager.h" | 10 #include "gpu/command_buffer/tests/gl_manager.h" |
| 11 #include "gpu/command_buffer/tests/gl_test_utils.h" | 11 #include "gpu/command_buffer/tests/gl_test_utils.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace gpu { | 15 namespace gpu { |
| 16 | 16 |
| 17 class CHROMIUMPathRenderingTest : public testing::Test { | 17 class CHROMIUMPathRenderingTest : public testing::Test { |
| 18 public: | 18 public: |
| 19 static const GLsizei kResolution = 100; | 19 static const GLsizei kResolution = 100; |
| 20 | 20 |
| 21 protected: | 21 protected: |
| 22 virtual void SetUp() { | 22 void SetUp() override { |
| 23 GLManager::Options options; | 23 GLManager::Options options; |
| 24 options.size = gfx::Size(kResolution, kResolution); | 24 options.size = gfx::Size(kResolution, kResolution); |
| 25 gl_.Initialize(options); | 25 gl_.Initialize(options); |
| 26 } | 26 } |
| 27 | 27 |
| 28 virtual void TearDown() { gl_.Destroy(); } | 28 void TearDown() override { gl_.Destroy(); } |
| 29 | 29 |
| 30 void ExpectEqualMatrix(const GLfloat* expected, const GLfloat* actual) { | 30 void ExpectEqualMatrix(const GLfloat* expected, const GLfloat* actual) { |
| 31 for (size_t i = 0; i < 16; ++i) { | 31 for (size_t i = 0; i < 16; ++i) { |
| 32 EXPECT_EQ(expected[i], actual[i]); | 32 EXPECT_EQ(expected[i], actual[i]); |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 void ExpectEqualMatrix(const GLfloat* expected, const GLint* actual) { | 35 void ExpectEqualMatrix(const GLfloat* expected, const GLint* actual) { |
| 36 for (size_t i = 0; i < 16; ++i) { | 36 for (size_t i = 0; i < 16; ++i) { |
| 37 EXPECT_EQ(static_cast<GLint>(round(expected[i])), actual[i]); | 37 EXPECT_EQ(static_cast<GLint>(round(expected[i])), actual[i]); |
| 38 } | 38 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 // This should fail. | 102 // This should fail. |
| 103 glMatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM + 1); | 103 glMatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM + 1); |
| 104 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_ENUM), glGetError()); | 104 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_ENUM), glGetError()); |
| 105 | 105 |
| 106 glMatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); | 106 glMatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM); |
| 107 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); | 107 EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace gpu | 110 } // namespace gpu |
| OLD | NEW |