Commit 6eb33bc0 authored by George Staplin's avatar George Staplin Committed by Jeremy Huddleston

XQuartz: GL: Remove the inclusion of glcontextmodes.h.

Add some commentary about future directions needed for the GLX drawable
creation and destruction code.

Match xalloc with xfree.

I made some minor formatting improvements.
(cherry picked from commit b772d64f)
parent 429b4b20
......@@ -81,7 +81,6 @@
typedef unsigned long long GLuint64EXT;
typedef long long GLint64EXT;
#include <Xplugin.h>
#include "glcontextmodes.h"
#include <glapi.h>
#include <glapitable.h>
......@@ -156,7 +155,7 @@ struct __GLXAquaContext {
struct __GLXAquaDrawable {
__GLXdrawable base;
__GLXdrawable base;
DrawablePtr pDraw;
xp_surface_id sid;
......@@ -1350,14 +1349,34 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
return &screen->base;
static void __glXAquaDrawableCopySubBuffer (__GLXdrawable *drawable,
int x, int y, int w, int h) {
/*TODO finish me*/
static void __glXAquaDrawableDestroy(__GLXdrawable *base) {
/* gstaplin: base is the head of the structure, so it's at the same
* offset in memory.
* Is this safe with strict aliasing? I noticed that the other dri code
* does this too...
__GLXAquaDrawable *glxPriv = (__GLXAquaDrawable *)base;
/* It doesn't work to call DRIDestroySurface here, the drawable's
already gone.. But dri.c notices the window destruction and
frees the surface itself. */
/*gstaplin: verify the statement above. The surface destroy
*messages weren't making it through, and may still not be.
*We need a good test case for surface creation and destruction.
*We also need a good way to enable introspection on the server
*to validate the test, beyond using gdb with print.
static __GLXdrawable *
......@@ -1371,11 +1390,13 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen,
GLAQUA_DEBUG_MSG("glAquaScreenCreateDrawable(%p,%p,%d,%p)\n", context, pDraw, drawId, modes);
glxPriv = xalloc(sizeof *glxPriv);
if (glxPriv == NULL) return NULL;
if(glxPriv == NULL)
return NULL;
memset(glxPriv, 0, sizeof *glxPriv);
if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, drawId, conf)) {
if(!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, drawId, conf)) {
return NULL;
......@@ -1383,7 +1404,7 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen,
glxPriv->base.destroy = __glXAquaDrawableDestroy;
glxPriv->base.resize = __glXAquaDrawableResize;
glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers;
// glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer;
glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer;
return &glxPriv->base;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment