diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-12 21:17:27 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-12 21:17:27 +0000 |
commit | c9e2cbbbcad5f0ae5b9c5ccaf6a36a8a4a61e0e7 (patch) | |
tree | e33d97dc2edae8702ddb6a17ba0d89a506412693 /ui/gl/gl_bindings.h | |
parent | fc25fd35147b2d5e74d5450e8586592c6a10813d (diff) | |
download | chromium_src-c9e2cbbbcad5f0ae5b9c5ccaf6a36a8a4a61e0e7.zip chromium_src-c9e2cbbbcad5f0ae5b9c5ccaf6a36a8a4a61e0e7.tar.gz chromium_src-c9e2cbbbcad5f0ae5b9c5ccaf6a36a8a4a61e0e7.tar.bz2 |
ui: Move gl/ directory out of gfx/, up to ui/.
BUG=104040
R=ben@chromium.org
TBR=tony@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10392068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136777 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/gl_bindings.h')
-rw-r--r-- | ui/gl/gl_bindings.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/ui/gl/gl_bindings.h b/ui/gl/gl_bindings.h new file mode 100644 index 0000000..625dac9 --- /dev/null +++ b/ui/gl/gl_bindings.h @@ -0,0 +1,105 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_GL_GL_BINDINGS_H_ +#define UI_GL_GL_BINDINGS_H_ +#pragma once + +// Includes the platform independent and platform dependent GL headers. +// Only include this in cc files. It pulls in system headers, including +// the X11 headers on linux, which define all kinds of macros that are +// liable to cause conflicts. + +#include <GL/gl.h> +#include <GL/glext.h> + +#include "base/logging.h" +#include "build/build_config.h" +#include "ui/gl/gl_export.h" + +// The standard OpenGL native extension headers are also included. +#if defined(OS_WIN) +#include <GL/wglext.h> +#elif defined(OS_MACOSX) +#include <OpenGL/OpenGL.h> +#elif defined(USE_X11) +#include <GL/glx.h> +#include <GL/glxext.h> + +// Undefine some macros defined by X headers. This is why this file should only +// be included in .cc files. +#undef Bool +#undef None +#undef Status +#endif + +#if defined(OS_WIN) +#define GL_BINDING_CALL WINAPI +#else +#define GL_BINDING_CALL +#endif + +#define GL_SERVICE_LOG(args) DLOG(INFO) << args; +#if defined(NDEBUG) + #define GL_SERVICE_LOG_CODE_BLOCK(code) +#else + #define GL_SERVICE_LOG_CODE_BLOCK(code) code +#endif + +// Forward declare OSMesa types. +typedef struct osmesa_context *OSMesaContext; +typedef void (*OSMESAproc)(); + +#if !defined(OS_MACOSX) + +// Forward declare EGL types. +typedef unsigned int EGLBoolean; +typedef unsigned int EGLenum; +typedef int EGLint; +typedef void *EGLConfig; +typedef void *EGLContext; +typedef void *EGLDisplay; +typedef void *EGLImageKHR; +typedef void *EGLSurface; +typedef void *EGLClientBuffer; +typedef void (*__eglMustCastToProperFunctionPointerType)(void); +typedef void* GLeglImageOES; + +#if defined(OS_WIN) +typedef HDC EGLNativeDisplayType; +typedef HBITMAP EGLNativePixmapType; +typedef HWND EGLNativeWindowType; +#elif defined(OS_ANDROID) +typedef void *EGLNativeDisplayType; +typedef struct egl_native_pixmap_t *EGLNativePixmapType; +typedef struct ANativeWindow *EGLNativeWindowType; +#else +typedef Display *EGLNativeDisplayType; +typedef Pixmap EGLNativePixmapType; +typedef Window EGLNativeWindowType; +#endif + +#endif // !OS_MACOSX + +#include "gl_bindings_autogen_gl.h" +#include "gl_bindings_autogen_osmesa.h" + +#if defined(OS_WIN) +#include "gl_bindings_autogen_egl.h" +#include "gl_bindings_autogen_wgl.h" +#elif defined(USE_X11) +#include "gl_bindings_autogen_egl.h" +#include "gl_bindings_autogen_glx.h" +#elif defined(OS_ANDROID) +#include "gl_bindings_autogen_egl.h" +#endif + +namespace gfx { + +// Find an entry point to the mock GL implementation. +void* GL_BINDING_CALL GetMockGLProcAddress(const char* name); + +} // namespace gfx + +#endif // UI_GL_GL_BINDINGS_H_ |