summaryrefslogtreecommitdiffstats
path: root/third_party/glew
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 21:26:35 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-02 21:26:35 +0000
commitd8b2821a636809da26ef711620e8e17276bc3e4c (patch)
tree3f8c8f38ea633c6b7c45627773e8ec8cb3257ff6 /third_party/glew
parentae40b572f534c3438e9d28ee9cf837531476ff17 (diff)
downloadchromium_src-d8b2821a636809da26ef711620e8e17276bc3e4c.zip
chromium_src-d8b2821a636809da26ef711620e8e17276bc3e4c.tar.gz
chromium_src-d8b2821a636809da26ef711620e8e17276bc3e4c.tar.bz2
Ported Chrome's WebGL implementation to Mac OS X. Removed code which
used the GPU to vertically flip the framebuffer. Updated GLEW to use standard dlopen / dlsym rather than deprecated mach-o/dyld functions; updated README.chromium. BUG=http://crbug.com/21852 TEST=none (runs existing WebGL tests; more coming) Review URL: http://codereview.chromium.org/256037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/glew')
-rw-r--r--third_party/glew/README.chromium7
-rw-r--r--third_party/glew/src/glew.c19
2 files changed, 9 insertions, 17 deletions
diff --git a/third_party/glew/README.chromium b/third_party/glew/README.chromium
index d04bb69..4d554c8 100644
--- a/third_party/glew/README.chromium
+++ b/third_party/glew/README.chromium
@@ -1,7 +1,10 @@
This is Chrome's local copy of the GLEW library, which is currently
used to interface to OpenGL and extensions to implement the WebGL
-specification. It is currently unmodified from the original
-distribution.
+specification.
+
+Compared to the original distribution, the implementation of
+NSGLGetProcAddress has been changed to use the standard dlfcn.h
+functions rather than the deprecated mach-o/dyld.h ones.
Originally obtained from http://glew.sourceforge.net/ . The
LICENSE.txt from that distribution has been preserved here.
diff --git a/third_party/glew/src/glew.c b/third_party/glew/src/glew.c
index 24c6a72..bbdc99c 100644
--- a/third_party/glew/src/glew.c
+++ b/third_party/glew/src/glew.c
@@ -66,29 +66,18 @@
#endif /* GLEW_MX */
#if defined(__APPLE__)
-#include <mach-o/dyld.h>
+#include <dlfcn.h>
#include <stdlib.h>
#include <string.h>
void* NSGLGetProcAddress (const GLubyte *name)
{
- static const struct mach_header* image = NULL;
- NSSymbol symbol;
- char* symbolName;
+ static void* image = NULL;
if (NULL == image)
{
- image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+ image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY | RTLD_LOCAL);
}
- /* prepend a '_' for the Unix C symbol mangling convention */
- symbolName = malloc(strlen((const char*)name) + 2);
- strcpy(symbolName+1, (const char*)name);
- symbolName[0] = '_';
- symbol = NULL;
- /* if (NSIsSymbolNameDefined(symbolName))
- symbol = NSLookupAndBindSymbol(symbolName); */
- symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL;
- free(symbolName);
- return symbol ? NSAddressOfSymbol(symbol) : NULL;
+ return image ? dlsym(image, (const char*) name) : NULL;
}
#endif /* __APPLE__ */