| 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 // Helper functions for GL. | 5 // Helper functions for GL. |
| 6 | 6 |
| 7 #ifndef GPU_COMMAND_BUFFER_TESTS_GL_TEST_UTILS_H_ | 7 #ifndef GPU_COMMAND_BUFFER_TESTS_GL_TEST_UTILS_H_ |
| 8 #define GPU_COMMAND_BUFFER_TESTS_GL_TEST_UTILS_H_ | 8 #define GPU_COMMAND_BUFFER_TESTS_GL_TEST_UTILS_H_ |
| 9 | 9 |
| 10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Returns the created buffer. | 57 // Returns the created buffer. |
| 58 static GLuint SetupColorsForUnitQuad( | 58 static GLuint SetupColorsForUnitQuad( |
| 59 GLint location, const GLfloat color[4], GLenum usage); | 59 GLint location, const GLfloat color[4], GLenum usage); |
| 60 | 60 |
| 61 // Checks an area of pixels for a color. | 61 // Checks an area of pixels for a color. |
| 62 static bool CheckPixels(GLint x, | 62 static bool CheckPixels(GLint x, |
| 63 GLint y, | 63 GLint y, |
| 64 GLsizei width, | 64 GLsizei width, |
| 65 GLsizei height, | 65 GLsizei height, |
| 66 GLint tolerance, | 66 GLint tolerance, |
| 67 const uint8_t* color); | 67 const uint8_t* color, |
| 68 int channel_count = 4); |
| 68 | 69 |
| 69 // Uses ReadPixels to save an area of the current FBO/Backbuffer. | 70 // Uses ReadPixels to save an area of the current FBO/Backbuffer. |
| 70 static bool SaveBackbufferAsBMP(const char* filename, int width, int height); | 71 static bool SaveBackbufferAsBMP(const char* filename, int width, int height); |
| 71 | 72 |
| 72 static void DrawTextureQuad(GLenum target, const gfx::Size& size); | 73 static void DrawTextureQuad(GLenum target, const gfx::Size& size); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 #endif // GPU_COMMAND_BUFFER_TESTS_GL_TEST_UTILS_H_ | 76 #endif // GPU_COMMAND_BUFFER_TESTS_GL_TEST_UTILS_H_ |
| OLD | NEW |