OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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 // Includes the platform independent and platform dependent GL headers. | |
6 // Only include this in cc files. It pulls in system headers, including | |
7 // the X11 headers on linux, which define all kinds of macros that are | |
8 // liable to cause conflicts. | |
9 | |
10 #ifndef UI_GFX_GL_GL_BINDINGS_H_ | |
11 #define UI_GFX_GL_GL_BINDINGS_H_ | |
12 #pragma once | |
13 | |
14 #include <GL/gl.h> | |
15 #include <GL/glext.h> | |
16 | |
17 #include "build/build_config.h" | |
18 #include "base/logging.h" | |
19 #include "ui/gfx/gl/gl_export.h" | |
20 | |
21 // The standard OpenGL native extension headers are also included. | |
22 #if defined(OS_WIN) | |
23 #include <GL/wglext.h> | |
24 #elif defined(OS_MACOSX) | |
25 #include <OpenGL/OpenGL.h> | |
26 #elif defined(USE_X11) | |
27 #include <GL/glx.h> | |
28 #include <GL/glxext.h> | |
29 | |
30 // Undefine some macros defined by X headers. This is why this file should only | |
31 // be included in .cc files. | |
32 #undef Bool | |
33 #undef None | |
34 #undef Status | |
35 #endif | |
36 | |
37 #if defined(OS_WIN) | |
38 #define GL_BINDING_CALL WINAPI | |
39 #else | |
40 #define GL_BINDING_CALL | |
41 #endif | |
42 | |
43 #define GL_SERVICE_LOG(args) DLOG(INFO) << args; | |
44 #if defined(NDEBUG) | |
45 #define GL_SERVICE_LOG_CODE_BLOCK(code) | |
46 #else | |
47 #define GL_SERVICE_LOG_CODE_BLOCK(code) code | |
48 #endif | |
49 | |
50 // Forward declare OSMesa types. | |
51 typedef struct osmesa_context *OSMesaContext; | |
52 typedef void (*OSMESAproc)(); | |
53 | |
54 #if !defined(OS_MACOSX) | |
55 | |
56 // Forward declare EGL types. | |
57 typedef unsigned int EGLBoolean; | |
58 typedef unsigned int EGLenum; | |
59 typedef int EGLint; | |
60 typedef void *EGLConfig; | |
61 typedef void *EGLContext; | |
62 typedef void *EGLDisplay; | |
63 typedef void *EGLImageKHR; | |
64 typedef void *EGLSurface; | |
65 typedef void *EGLClientBuffer; | |
66 typedef void (*__eglMustCastToProperFunctionPointerType)(void); | |
67 typedef void* GLeglImageOES; | |
68 | |
69 #if defined(OS_WIN) | |
70 typedef HDC EGLNativeDisplayType; | |
71 typedef HBITMAP EGLNativePixmapType; | |
72 typedef HWND EGLNativeWindowType; | |
73 #elif defined(OS_ANDROID) | |
74 typedef void *EGLNativeDisplayType; | |
75 typedef struct egl_native_pixmap_t *EGLNativePixmapType; | |
76 typedef struct ANativeWindow *EGLNativeWindowType; | |
77 #else | |
78 typedef Display *EGLNativeDisplayType; | |
79 typedef Pixmap EGLNativePixmapType; | |
80 typedef Window EGLNativeWindowType; | |
81 #endif | |
82 | |
83 #endif // !OS_MACOSX | |
84 | |
85 #include "gl_bindings_autogen_gl.h" | |
86 #include "gl_bindings_autogen_osmesa.h" | |
87 | |
88 #if defined(OS_WIN) | |
89 #include "gl_bindings_autogen_egl.h" | |
90 #include "gl_bindings_autogen_wgl.h" | |
91 #elif defined(USE_X11) | |
92 #include "gl_bindings_autogen_egl.h" | |
93 #include "gl_bindings_autogen_glx.h" | |
94 #elif defined(OS_ANDROID) | |
95 #include "gl_bindings_autogen_egl.h" | |
96 #endif | |
97 | |
98 namespace gfx { | |
99 | |
100 // Find an entry point to the mock GL implementation. | |
101 void* GL_BINDING_CALL GetMockGLProcAddress(const char* name); | |
102 | |
103 } // namespace gfx | |
104 | |
105 #endif // UI_GFX_GL_GL_BINDINGS_H_ | |
OLD | NEW |