OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 | 13 |
14 #define SHADER(Src) #Src | 14 #define SHADER(Src) #Src |
15 | 15 |
16 namespace gpu { | 16 namespace gpu { |
17 | 17 |
18 class GLStreamDrawTest : public testing::Test { | 18 class GLStreamDrawTest : public testing::Test { |
19 protected: | 19 protected: |
20 static const int kSize = 4; | 20 static const int kSize = 4; |
21 | 21 |
22 virtual void SetUp() { | 22 void SetUp() override { |
23 GLManager::Options options; | 23 GLManager::Options options; |
24 options.size = gfx::Size(kSize, kSize); | 24 options.size = gfx::Size(kSize, kSize); |
25 gl_.Initialize(options); | 25 gl_.Initialize(options); |
26 } | 26 } |
27 | 27 |
28 virtual void TearDown() { | 28 void TearDown() override { gl_.Destroy(); } |
29 gl_.Destroy(); | |
30 } | |
31 | 29 |
32 GLManager gl_; | 30 GLManager gl_; |
33 }; | 31 }; |
34 | 32 |
35 namespace { | 33 namespace { |
36 | 34 |
37 GLuint SetupProgram() { | 35 GLuint SetupProgram() { |
38 static const char* v_shader_str = SHADER( | 36 static const char* v_shader_str = SHADER( |
39 attribute vec4 a_position; | 37 attribute vec4 a_position; |
40 attribute vec4 a_color; | 38 attribute vec4 a_color; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 glDrawArrays(GL_TRIANGLES, 0, 6); | 149 glDrawArrays(GL_TRIANGLES, 0, 6); |
152 EXPECT_TRUE( | 150 EXPECT_TRUE( |
153 GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_green)); | 151 GLTestHelper::CheckPixels(0, 0, kSize, kSize, 0, expected_green)); |
154 } | 152 } |
155 | 153 |
156 GLTestHelper::CheckGLError("no errors", __LINE__); | 154 GLTestHelper::CheckGLError("no errors", __LINE__); |
157 } | 155 } |
158 | 156 |
159 } // namespace gpu | 157 } // namespace gpu |
160 | 158 |
OLD | NEW |