summaryrefslogtreecommitdiffstats
path: root/third_party/glew/include
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 22:08:54 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 22:08:54 +0000
commit4bedba77d40df5fa5f1e00f5918123ee8711ca76 (patch)
tree0d34ff8aac44eaf1281fbcbdbe38867cb2a35f19 /third_party/glew/include
parent163cf4a0682a5e32f9db5e413dab296f17027015 (diff)
downloadchromium_src-4bedba77d40df5fa5f1e00f5918123ee8711ca76.zip
chromium_src-4bedba77d40df5fa5f1e00f5918123ee8711ca76.tar.gz
chromium_src-4bedba77d40df5fa5f1e00f5918123ee8711ca76.tar.bz2
Added OSMesa based GLContext.
- Renders 3D using Mesa offscreen software renderer. - Will be used to run 3D tests on bots that do not support native OpenGL. - Extended glew library to use the osmesa shared library instead of the regular OpenGL one if it is in the search path. - Only works on Windows with this changelist, though other platforms will continue to use native OpenGL. - Added a stub GLContext implementation for use in unit tests. Review URL: http://codereview.chromium.org/1629029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/glew/include')
-rw-r--r--third_party/glew/include/GL/glew.h3
-rw-r--r--third_party/glew/include/GL/osmew.h51
2 files changed, 54 insertions, 0 deletions
diff --git a/third_party/glew/include/GL/glew.h b/third_party/glew/include/GL/glew.h
index 90438a7..34183a9 100644
--- a/third_party/glew/include/GL/glew.h
+++ b/third_party/glew/include/GL/glew.h
@@ -12863,6 +12863,8 @@ GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint;
}; /* GLEWContextStruct */
#endif /* GLEW_MX */
+typedef void* (GLAPIENTRY * PFNOSMESAGETPROCADDRESSPROC) (const GLubyte* name);
+
/* ------------------------------------------------------------------------- */
/* error codes */
@@ -12898,6 +12900,7 @@ GLEWAPI GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name);
#else /* GLEW_MX */
+void osmewContextInit ();
GLEWAPI GLenum glewInit ();
GLEWAPI GLenum glewInitGL2Hack ();
GLEWAPI GLboolean glewIsSupported (const char* name);
diff --git a/third_party/glew/include/GL/osmew.h b/third_party/glew/include/GL/osmew.h
new file mode 100644
index 0000000..4816694
--- /dev/null
+++ b/third_party/glew/include/GL/osmew.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2009 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 __osmew_h__
+#define __osmew_h__
+#define __OSMEW_H__
+
+#include <GL/glew.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(GLAPIENTRY)
+#if defined(_WIN32)
+#define GLAPIENTRY __stdcall
+#else
+#define GLAPIENTRY
+#endif
+#endif
+
+#define OSMEW_GET_FUN(x) x
+
+// Subset of OSMesa functions.
+
+typedef struct osmesa_context *OSMesaContext;
+typedef OSMesaContext (GLAPIENTRY * PFNOSMESACREATECONTEXTPROC) (GLenum format, OSMesaContext sharelist);
+typedef void (GLAPIENTRY * PFNOSMESADESTROYCONTEXTPROC) (OSMesaContext ctx);
+typedef GLboolean (GLAPIENTRY * PFNOSMESAMAKECURRENTPROC) (OSMesaContext ctx, void* buffer, GLenum type, GLsizei width, GLsizei height);
+typedef OSMesaContext (GLAPIENTRY * PFNOSMESAGETCURRENTCONTEXTPROC) (void);
+
+#define OSMesaCreateContext OSMEW_GET_FUN(__osmesaCreateContext)
+#define OSMesaDestroyContext OSMEW_GET_FUN(__osmesaDestroyContext)
+#define OSMesaMakeCurrent OSMEW_GET_FUN(__osmesaMakeCurrent)
+#define OSMesaGetCurrentContext OSMEW_GET_FUN(__osmesaGetCurrentContext)
+
+extern PFNOSMESACREATECONTEXTPROC __osmesaCreateContext;
+extern PFNOSMESADESTROYCONTEXTPROC __osmesaDestroyContext;
+extern PFNOSMESAMAKECURRENTPROC __osmesaMakeCurrent;
+extern PFNOSMESAGETCURRENTCONTEXTPROC __osmesaGetCurrentContext;
+
+void osmewInit ();
+
+#undef GLAPIENTRY
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __osmew_h__ */