OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef UI_GL_TEST_GL_TEST_HELPER_H_ | 5 #ifndef UI_GL_TEST_GL_TEST_HELPER_H_ |
6 #define UI_GL_TEST_GL_TEST_HELPER_H_ | 6 #define UI_GL_TEST_GL_TEST_HELPER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
9 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
10 | 11 |
11 namespace gl { | 12 namespace gl { |
12 | 13 |
13 class GLTestHelper { | 14 class GLTestHelper { |
14 public: | 15 public: |
15 // Creates a texture object. | 16 // Creates a texture object. |
16 // Does not check for errors, always returns texture. | 17 // Does not check for errors, always returns texture. |
17 static GLuint CreateTexture(GLenum target); | 18 static GLuint CreateTexture(GLenum target); |
18 | 19 |
19 // Creates a framebuffer, attaches a color buffer, and checks for errors. | 20 // Creates a framebuffer, attaches a color buffer, and checks for errors. |
20 // Returns framebuffer, 0 on failure. | 21 // Returns framebuffer, 0 on failure. |
21 static GLuint SetupFramebuffer(int width, int height); | 22 static GLuint SetupFramebuffer(int width, int height); |
22 | 23 |
23 // Checks an area of pixels for a color. | 24 // Checks an area of pixels for a color. |
24 static bool CheckPixels(GLint x, | 25 static bool CheckPixels(GLint x, |
25 GLint y, | 26 GLint y, |
26 GLsizei width, | 27 GLsizei width, |
27 GLsizei height, | 28 GLsizei height, |
28 const uint8_t expected_color[4]); | 29 const uint8_t expected_color[4]); |
29 }; | 30 }; |
30 | 31 |
31 } // namespace gl | 32 } // namespace gl |
32 | 33 |
33 #endif // UI_GL_TEST_GL_TEST_HELPER_H_ | 34 #endif // UI_GL_TEST_GL_TEST_HELPER_H_ |
OLD | NEW |