OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file implements glue to a GL interface so we can mock it for unit | 5 // This file implements glue to a GL interface so we can mock it for unit |
6 // testing. It has to be Desktop GL, not GLES2 as it is used to test the service | 6 // testing. It has to be Desktop GL, not GLES2 as it is used to test the service |
7 // side code. | 7 // side code. |
8 | 8 |
9 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_INTERFACE_H_ | 9 #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_INTERFACE_H_ |
10 #define GPU_COMMAND_BUFFER_SERVICE_GL_INTERFACE_H_ | 10 #define GPU_COMMAND_BUFFER_SERVICE_GL_INTERFACE_H_ |
11 | 11 |
12 #include <GLES2/gl2types.h> | 12 #include <GLES2/gl2types.h> |
13 | 13 |
| 14 // These are Desktop GL constants that we want to test that our GLES2 |
| 15 // implemenation does not let through. |
| 16 #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B |
| 17 #define GL_BGR 0x80E0 |
| 18 #define GL_BGRA 0x80E1 |
| 19 #define GL_UNPACK_SWAP_BYTES 0x0CF0 |
| 20 #define GL_PACK_SWAP_BYTES 0x0D00 |
| 21 #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 |
| 22 #define GL_QUADS 0x0007 |
| 23 #define GL_POLYGON 0x0009 |
| 24 #define GL_FOG 0x0B60 |
| 25 #define GL_CLIP_PLANE0 0x3000 |
| 26 #define GL_GENERATE_MIPMAP 0x8191 |
| 27 #define GL_PIXEL_PACK_BUFFER 0x88EB |
| 28 #define GL_POINT_SPRITE 0x8861 |
| 29 #define GL_MIN 0x8007 |
| 30 #define GL_MAX 0x8008 |
| 31 #define GL_TEXTURE_1D 0x0DE0 |
| 32 #define GL_TEXTURE_3D 0x806F |
| 33 #define GL_DOUBLE 0x140A |
| 34 |
14 namespace gles2 { | 35 namespace gles2 { |
15 | 36 |
16 class GLInterface { | 37 class GLInterface { |
17 public: | 38 public: |
18 virtual ~GLInterface() { | 39 virtual ~GLInterface() { |
19 } | 40 } |
20 | 41 |
21 static void SetGLInterface(GLInterface* gl_interface); | 42 static void SetGLInterface(GLInterface* gl_interface); |
22 | 43 |
23 static GLInterface* GetGLInterface(); | 44 static GLInterface* GetGLInterface(); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 #define glVertexAttrib3fv GL_IFACE_GET_FUN(VertexAttrib3fv) | 543 #define glVertexAttrib3fv GL_IFACE_GET_FUN(VertexAttrib3fv) |
523 #define glVertexAttrib4f GL_IFACE_GET_FUN(VertexAttrib4f) | 544 #define glVertexAttrib4f GL_IFACE_GET_FUN(VertexAttrib4f) |
524 #define glVertexAttrib4fv GL_IFACE_GET_FUN(VertexAttrib4fv) | 545 #define glVertexAttrib4fv GL_IFACE_GET_FUN(VertexAttrib4fv) |
525 #define glVertexAttribPointer GL_IFACE_GET_FUN(VertexAttribPointer) | 546 #define glVertexAttribPointer GL_IFACE_GET_FUN(VertexAttribPointer) |
526 #define glViewport GL_IFACE_GET_FUN(Viewport) | 547 #define glViewport GL_IFACE_GET_FUN(Viewport) |
527 | 548 |
528 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_INTERFACE_H_ | 549 #endif // GPU_COMMAND_BUFFER_SERVICE_GL_INTERFACE_H_ |
529 | 550 |
530 | 551 |
531 | 552 |
OLD | NEW |