OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 BENCH_GL_UTILS_H_ | 5 #ifndef BENCH_GL_UTILS_H_ |
6 #define BENCH_GL_UTILS_H_ | 6 #define BENCH_GL_UTILS_H_ |
7 | 7 |
8 #if defined(USE_OPENGLES) | 8 #if defined(USE_OPENGLES) |
9 #include "GLES2/gl2.h" | 9 #include "GLES2/gl2.h" |
10 #elif defined(USE_OPENGL) | 10 #elif defined(USE_OPENGL) |
11 #include "GL/gl.h" | 11 #include "GL/gl.h" |
12 #endif | 12 #endif |
13 | 13 |
| 14 #include "base/file_path.h" |
14 | 15 |
15 void SetBasePathFromArgv0(const char* argv0, const char* relative); | 16 void SetBasePathFromArgv0(const char* argv0, const char* relative); |
16 void *MmapFile(const char *name, size_t *length); | 17 void *MmapFile(const char *name, size_t *length); |
| 18 const FilePath& GetBasePath(); |
17 | 19 |
18 namespace glbench { | 20 namespace glbench { |
19 | 21 |
20 GLuint SetupTexture(GLsizei size_log2); | 22 GLuint SetupTexture(GLsizei size_log2); |
21 GLuint SetupVBO(GLenum target, GLsizeiptr size, const GLvoid *data); | 23 GLuint SetupVBO(GLenum target, GLsizeiptr size, const GLvoid *data); |
22 void CreateLattice(GLfloat **vertices, GLsizeiptr *size, | 24 void CreateLattice(GLfloat **vertices, GLsizeiptr *size, |
23 GLfloat size_x, GLfloat size_y, int width, int height); | 25 GLfloat size_x, GLfloat size_y, int width, int height); |
24 int CreateMesh(GLuint **indices, GLsizeiptr *size, | 26 int CreateMesh(GLuint **indices, GLsizeiptr *size, |
25 int width, int height, int culled_ratio); | 27 int width, int height, int culled_ratio); |
26 GLuint InitShaderProgram(const char *vertex_src, const char *fragment_src); | 28 GLuint InitShaderProgram(const char *vertex_src, const char *fragment_src); |
27 GLuint InitShaderProgramWithHeader(const char* header, | 29 GLuint InitShaderProgramWithHeader(const char* header, |
28 const char* vertex_src, | 30 const char* vertex_src, |
29 const char* fragment_src); | 31 const char* fragment_src); |
30 | 32 |
31 } // namespace glbench | 33 } // namespace glbench |
32 | 34 |
33 #endif // BENCH_GL_UTILS_H_ | 35 #endif // BENCH_GL_UTILS_H_ |
OLD | NEW |