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_BENCHMARK_GPU_PAINTER_H_ | |
scherkus (not reviewing)
2010/11/30 23:36:10
should be MEDIA_TOOLS_SHADER_BENCH_GPU_PAINTER_H_
vrk (LEFT CHROMIUM)
2010/12/01 02:46:11
Good catch, thanks! Done.
| |
6 #define MEDIA_TOOLS_BENCHMARK_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 public: | |
16 GPUPainter(); | |
17 | |
18 // Sets context for subsequent gl calls in this painter. | |
19 virtual void SetGLContext(gfx::GLContext* context); | |
20 | |
21 protected: | |
scherkus (not reviewing)
2010/11/30 23:36:10
try to avoid protected
I'd simply make the method
vrk (LEFT CHROMIUM)
2010/12/01 02:46:11
Done.
| |
22 // Loads shader into given context, from the source code of the | |
23 // shader. type refers to the shader type, either GL_VERTEX_SHADER or | |
24 // GL_FRAGMENT_SHADER. Returns id of shader. | |
25 static GLuint LoadShader(gfx::GLContext* context, unsigned type, | |
scherkus (not reviewing)
2010/11/30 23:36:10
might be wrong but looks like this is only used by
vrk (LEFT CHROMIUM)
2010/12/01 02:46:11
Made into private member function instead.
| |
26 const char* shader_source); | |
27 | |
28 // Creates shader program into given context, from the vertex and fragment | |
29 // shader source code. Returns the id of the shader program. | |
30 static GLuint CreateShaderProgram(gfx::GLContext* context, | |
scherkus (not reviewing)
2010/11/30 23:36:10
does it makes sense to have this be a member funct
vrk (LEFT CHROMIUM)
2010/12/01 02:46:11
Yeah, makes sense! I was just unnecessarily genera
| |
31 const char* vertex_shader_source, | |
32 const char* fragment_shader_source); | |
33 | |
34 // Reference to the gl context. | |
35 gfx::GLContext* context_; | |
36 | |
37 private: | |
38 DISALLOW_COPY_AND_ASSIGN(GPUPainter); | |
39 }; | |
40 | |
41 #endif // MEDIA_TOOLS_BENCHMARK_GPU_PAINTER_H_ | |
OLD | NEW |