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

Side by Side Diff: ui/gl/gl_helper.h

Issue 1419733005: gpu: Add YCbCr 420v extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually enable/disable capabilities. Typo. Created 5 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
« no previous file with comments | « ui/gl/gl_bindings.h ('k') | ui/gl/gl_helper.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 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_GL_HELPER_H_
6 #define UI_GL_TEST_GL_TEST_HELPER_H_ 6 #define UI_GL_GL_HELPER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "ui/gl/gl_bindings.h" 9 #include "ui/gl/gl_bindings.h"
10 #include "ui/gl/gl_export.h"
10 11
11 namespace gl { 12 namespace gfx {
12 13
13 class GLTestHelper { 14 class GL_EXPORT GLHelper {
14 public: 15 public:
15 // Creates a texture object.
16 // Does not check for errors, always returns texture.
17 static GLuint CreateTexture(GLenum target);
18
19 // Compiles a shader. 16 // Compiles a shader.
20 // Does not check for errors, always returns shader. 17 // Does not check for errors, always returns shader.
21 static GLuint CompileShader(GLenum type, const char* src); 18 static GLuint CompileShader(GLenum type, const char* src);
22 19
23 // Compiles a shader and checks for compilation errors. 20 // Compiles a shader and checks for compilation errors.
24 // Returns shader, 0 on failure. 21 // Returns shader, 0 on failure.
25 static GLuint LoadShader(GLenum type, const char* src); 22 static GLuint LoadShader(GLenum type, const char* src);
26 23
27 // Attaches 2 shaders and links them to a program. 24 // Attaches 2 shaders and links them to a program.
28 // Does not check for errors, always returns program. 25 // Does not check for errors, always returns program.
29 static GLuint LinkProgram(GLuint vertex_shader, GLuint fragment_shader); 26 static GLuint LinkProgram(GLuint vertex_shader, GLuint fragment_shader);
30 27
31 // Attaches 2 shaders, links them to a program, and checks for errors. 28 // Attaches 2 shaders, links them to a program, and checks for errors.
32 // Returns program, 0 on failure. 29 // Returns program, 0 on failure.
33 static GLuint SetupProgram(GLuint vertex_shader, GLuint fragment_shader); 30 static GLuint SetupProgram(GLuint vertex_shader, GLuint fragment_shader);
34
35 // Creates a framebuffer, attaches a color buffer, and checks for errors.
36 // Returns framebuffer, 0 on failure.
37 static GLuint SetupFramebuffer(int width, int height);
38
39 // Checks an area of pixels for a color.
40 static bool CheckPixels(GLint x,
41 GLint y,
42 GLsizei width,
43 GLsizei height,
44 const uint8_t expected_color[4]);
45 }; 31 };
46 32
47 } // namespace gl 33 } // namespace gfx
48 34
49 #endif // UI_GL_TEST_GL_TEST_HELPER_H_ 35 #endif // UI_GL_GL_HELPER_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_bindings.h ('k') | ui/gl/gl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698