Mesa (master): apple: Remove apple_glx_get_proc_address

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed Jun 8 06:07:04 UTC 2011


Module: Mesa
Branch: master
Commit: e157f381f21a1d5307f64b6ec3cc1b26d4ddf576
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e157f381f21a1d5307f64b6ec3cc1b26d4ddf576

Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Jun  7 19:26:53 2011 -0700

apple: Remove apple_glx_get_proc_address

Now that we're using glapi, we don't need to special case this.

Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

---

 src/glx/apple/apple_glx.c |   47 ---------------------------------------------
 src/glx/apple/apple_glx.h |    1 -
 src/glx/glxcmds.c         |    6 -----
 3 files changed, 0 insertions(+), 54 deletions(-)

diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c
index e8f9440..a76cb4c 100644
--- a/src/glx/apple/apple_glx.c
+++ b/src/glx/apple/apple_glx.c
@@ -43,12 +43,6 @@ static int dri_event_base = 0;
 
 const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
 
-#ifndef OPENGL_LIB_PATH
-#define OPENGL_LIB_PATH "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"
-#endif
-
-static void *libgl_handle = NULL;
-
 static bool diagnostic = false;
 
 void
@@ -138,7 +132,6 @@ apple_init_glx(Display * dpy)
 
    apple_cgl_init();
    apple_xgl_init_direct();
-   libgl_handle = dlopen(OPENGL_LIB_PATH, RTLD_LAZY);
    (void) apple_glx_get_client_id();
 
    XAppleDRISetSurfaceNotifyHandler(surface_notify_handler);
@@ -160,46 +153,6 @@ apple_glx_swap_buffers(void *ptr)
    apple_cgl.flush_drawable(ac->context_obj);
 }
 
-void *
-apple_glx_get_proc_address(const GLubyte * procname)
-{
-   size_t len;
-   void *h, *s;
-   char *pname = (char *) procname;
-
-   assert(NULL != procname);
-   len = strlen(pname);
-
-   if (len < 3) {
-      return NULL;
-   }
-
-   if ((pname != strstr(pname, "glX")) && (pname != strstr(pname, "gl"))) {
-      fprintf(stderr,
-              "warning: get proc address request is not for a gl or glX function");
-      return NULL;
-   }
-
-   /* Search using the default symbols first. */
-   (void) dlerror();            /*drain dlerror */
-   h = dlopen(NULL, RTLD_NOW);
-   if (NULL == h) {
-      fprintf(stderr, "warning: get proc address: %s\n", dlerror());
-      return NULL;
-   }
-
-   s = dlsym(h, pname);
-
-   if (NULL == s) {
-      /* Try the libGL.dylib from the OpenGL.framework. */
-      s = dlsym(libgl_handle, pname);
-   }
-
-   dlclose(h);
-
-   return s;
-}
-
 void
 apple_glx_waitx(Display * dpy, void *ptr)
 {
diff --git a/src/glx/apple/apple_glx.h b/src/glx/apple/apple_glx.h
index 5e81c59..25f5ea6 100644
--- a/src/glx/apple/apple_glx.h
+++ b/src/glx/apple/apple_glx.h
@@ -42,7 +42,6 @@ void apple_glx_diagnostic(const char *fmt, ...);
 xp_client_id apple_glx_get_client_id(void);
 bool apple_init_glx(Display * dpy);
 void apple_glx_swap_buffers(void *ptr);
-void *apple_glx_get_proc_address(const GLubyte * procname);
 void apple_glx_waitx(Display * dpy, void *ptr);
 int apple_get_dri_event_base(void);
 
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 783a159..774d38b 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -2479,7 +2479,6 @@ static const struct name_address_pair GLX_functions[] = {
    {NULL, NULL}                 /* end of list */
 };
 
-#ifndef GLX_USE_APPLEGL
 static const GLvoid *
 get_glx_proc_address(const char *funcName)
 {
@@ -2493,7 +2492,6 @@ get_glx_proc_address(const char *funcName)
 
    return NULL;
 }
-#endif
 
 /**
  * Get the address of a named GL function.  This is the pre-GLX 1.4 name for
@@ -2516,9 +2514,6 @@ _X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
     * DRI based drivers from searching the core GL function table for
     * internal API functions.
     */
-#ifdef GLX_USE_APPLEGL
-   f = (gl_function) apple_glx_get_proc_address(procName);
-#else
    f = (gl_function) get_glx_proc_address((const char *) procName);
    if ((f == NULL) && (procName[0] == 'g') && (procName[1] == 'l')
        && (procName[2] != 'X')) {
@@ -2528,7 +2523,6 @@ _X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
       if (!f)
          f = (gl_function) _glapi_get_proc_address((const char *) procName);
    }
-#endif
    return f;
 }
 




More information about the mesa-commit mailing list