OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_TOOLS_SHADER_BENCH_GPU_PAINTER_H_ | |
6 #define MEDIA_TOOLS_SHADER_BENCH_GPU_PAINTER_H_ | |
7 | |
8 #include "app/gfx/gl/gl_bindings.h" | |
9 #include "app/gfx/gl/gl_context.h" | |
10 #include "app/gfx/gl/gl_implementation.h" | |
11 #include "media/tools/shader_bench/painter.h" | |
12 | |
13 // Class that renders video frames to a window via GPU. | |
14 class GPUPainter : public Painter { | |
15 | |
scherkus (not reviewing)
2010/12/01 05:28:47
nit: no blank line
vrk (LEFT CHROMIUM)
2010/12/01 18:05:53
Done.
| |
16 public: | |
17 GPUPainter(); | |
18 virtual ~GPUPainter(); | |
19 | |
20 // Returns a reference to the GL context. | |
21 gfx::GLContext* context() const { return context_; } | |
22 | |
23 // Sets context for subsequent gl calls in this painter. | |
24 virtual void SetGLContext(gfx::GLContext* context); | |
25 | |
26 // Creates shader program into given context, from the vertex and fragment | |
27 // shader source code. Returns the id of the shader program. | |
28 virtual GLuint CreateShaderProgram(const char* vertex_shader_source, | |
29 const char* fragment_shader_source); | |
30 | |
31 private: | |
32 // Loads shader into given context, from the source code of the | |
33 // shader. type refers to the shader type, either GL_VERTEX_SHADER or | |
34 // GL_FRAGMENT_SHADER. Returns id of shader. | |
35 GLuint LoadShader(unsigned type, const char* shader_source); | |
36 | |
37 // Reference to the gl context. | |
38 gfx::GLContext* context_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(GPUPainter); | |
41 }; | |
42 | |
43 #endif // MEDIA_TOOLS_SHADER_BENCH_GPU_PAINTER_H_ | |
OLD | NEW |