Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(597)

Side by Side Diff: gpu/command_buffer/tests/gl_test_utils.h

Issue 11568029: Add a command to lose the context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add docs, lose parent and children, fix typo Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.cc ('k') | gpu/command_buffer/tests/gl_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 12
13 class GLTestHelper { 13 class GLTestHelper {
14 public: 14 public:
15 static const uint8 kCheckClearValue = 123u;
16
15 static bool HasExtension(const char* extension); 17 static bool HasExtension(const char* extension);
16 static bool CheckGLError(const char* msg, int line); 18 static bool CheckGLError(const char* msg, int line);
17 19
18 // Compiles a shader. 20 // Compiles a shader.
19 // Returns shader, 0 on failure.. 21 // Returns shader, 0 on failure..
20 static GLuint LoadShader(GLenum type, const char* shaderSrc); 22 static GLuint LoadShader(GLenum type, const char* shaderSrc);
21 23
22 // Attaches 2 shaders and links them to a program. 24 // Attaches 2 shaders and links them to a program.
23 // Returns program, 0 on failure.. 25 // Returns program, 0 on failure..
24 static GLuint SetupProgram(GLuint vertex_shader, GLuint fragment_shader); 26 static GLuint SetupProgram(GLuint vertex_shader, GLuint fragment_shader);
(...skipping 14 matching lines...) Expand all
39 const uint8* color); 41 const uint8* color);
40 42
41 // Uses ReadPixels to save an area of the current FBO/Backbuffer. 43 // Uses ReadPixels to save an area of the current FBO/Backbuffer.
42 static bool SaveBackbufferAsBMP(const char* filename, int width, int height); 44 static bool SaveBackbufferAsBMP(const char* filename, int width, int height);
43 45
44 // Run unit tests. 46 // Run unit tests.
45 static int RunTests(int argc, char** argv); 47 static int RunTests(int argc, char** argv);
46 }; 48 };
47 49
48 #endif // GPU_COMMAND_BUFFER_TESTS_GL_TEST_UTILS_H_ 50 #endif // GPU_COMMAND_BUFFER_TESTS_GL_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.cc ('k') | gpu/command_buffer/tests/gl_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698