apple: Build darwin using applegl rather than indirect
authorJeremy Huddleston <jeremyhu@apple.com>
Sun, 5 Jun 2011 22:50:55 +0000 (18:50 -0400)
committerJeremy Huddleston <jeremyhu@apple.com>
Mon, 6 Jun 2011 00:52:15 +0000 (20:52 -0400)
This reverts portions of 6849916170c0275c13510251a7b217c20f2b993e that caused
the darwin config to fail to build due to missing implementations in that
commit.

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
src/glx/glxclient.h
src/glx/glxcmds.c
src/glx/glxext.c

index f9ab222d16e4f4fad46c35638cdb970245713274..9262f86f1f33b9199497101ce11182871536246f 100644 (file)
@@ -769,7 +769,19 @@ GarbageCollectDRIDrawables(struct glx_screen *psc);
 
 extern __GLXDRIdrawable *
 GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable);
+#endif
+
+#ifdef GLX_USE_APPLEGL
+extern struct glx_screen *
+applegl_create_screen(int screen, struct glx_display * priv);
+
+extern struct glx_context *
+applegl_create_context(struct glx_screen *psc,
+                       struct glx_config *mode,
+                       struct glx_context *shareList, int renderType);
 
+extern int
+applegl_create_display(struct glx_display *display);
 #endif
 
 extern struct glx_context dummyContext;
index 5bd989e7dcfa494d06e02637e98ca8573e34d1d6..783a1594512f2613cfc3eb84796ff3cc25c12ef9 100644 (file)
@@ -224,10 +224,14 @@ CreateContext(Display *dpy, int generic_id, struct glx_config *config,
       return NULL;
 
    gc = NULL;
+#ifdef GLX_USE_APPLEGL
+   gc = applegl_create_context(psc, config, shareList, renderType);
+#else
    if (allowDirect && psc->vtable->create_context)
       gc = psc->vtable->create_context(psc, config, shareList, renderType);
    if (!gc)
       gc = indirect_create_context(psc, config, shareList, renderType);
+#endif
    if (!gc)
       return NULL;
 
index 278c71978fa9b372a0a9243153435c9570465adc..73c332793a0f95ac69fc3dde3f54ddedf74d934f 100644 (file)
@@ -779,11 +779,12 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv)
         psc = (*priv->driswDisplay->createScreen) (i, priv);
 #endif
 #if defined(GLX_USE_APPLEGL)
-      if (psc == NULL && priv->appleglDisplay)
-        psc = (*priv->appleglDisplay->createScreen) (i, priv);
-#endif
+      if (psc == NULL)
+         psc = applegl_create_screen(i, priv);
+#else
       if (psc == NULL)
         psc = indirect_create_screen(i, priv);
+#endif
       priv->screens[i] = psc;
    }
    SyncHandle();