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

Side by Side Diff: media/tools/shader_bench/gpu_painter.h

Issue 4873002: Benchmark tool for GPU-accelerated video rendering (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 10 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
OLDNEW
(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 public:
16 GPUPainter();
17 virtual ~GPUPainter();
18
19 // Returns a reference to the GL context.
20 gfx::GLContext* context() const { return context_; }
21
22 // Sets context for subsequent gl calls in this painter.
23 virtual void SetGLContext(gfx::GLContext* context);
24
25 // Creates shader program into given context, from the vertex and fragment
26 // shader source code. Returns the id of the shader program.
27 virtual GLuint CreateShaderProgram(const char* vertex_shader_source,
28 const char* fragment_shader_source);
29
30 private:
31 // Loads shader into given context, from the source code of the
32 // shader. type refers to the shader type, either GL_VERTEX_SHADER or
33 // GL_FRAGMENT_SHADER. Returns id of shader.
34 GLuint LoadShader(unsigned type, const char* shader_source);
35
36 // Reference to the gl context.
37 gfx::GLContext* context_;
38
39 DISALLOW_COPY_AND_ASSIGN(GPUPainter);
40 };
41
42 #endif // MEDIA_TOOLS_SHADER_BENCH_GPU_PAINTER_H_
OLDNEW
« no previous file with comments | « media/tools/shader_bench/gpu_color_painter_exp.cc ('k') | media/tools/shader_bench/gpu_painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698