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 b772d64fce31d16b498c621096e39d5203994d6e)
This commit is contained in:
parent
429b4b20d5
commit
6eb33bc0cb
|
@ -81,7 +81,6 @@
|
||||||
typedef unsigned long long GLuint64EXT;
|
typedef unsigned long long GLuint64EXT;
|
||||||
typedef long long GLint64EXT;
|
typedef long long GLint64EXT;
|
||||||
#include <Xplugin.h>
|
#include <Xplugin.h>
|
||||||
#include "glcontextmodes.h"
|
|
||||||
#include <glapi.h>
|
#include <glapi.h>
|
||||||
#include <glapitable.h>
|
#include <glapitable.h>
|
||||||
|
|
||||||
|
@ -1350,14 +1349,34 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
|
||||||
return &screen->base;
|
return &screen->base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void __glXAquaDrawableCopySubBuffer (__GLXdrawable *drawable,
|
||||||
|
int x, int y, int w, int h) {
|
||||||
|
/*TODO finish me*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void __glXAquaDrawableDestroy(__GLXdrawable *base) {
|
static void __glXAquaDrawableDestroy(__GLXdrawable *base) {
|
||||||
GLAQUA_DEBUG_MSG("glAquaDestroyDrawablePrivate\n");
|
/* 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;
|
||||||
|
|
||||||
|
GLAQUA_DEBUG_MSG(__func__);
|
||||||
|
|
||||||
/* It doesn't work to call DRIDestroySurface here, the drawable's
|
/* It doesn't work to call DRIDestroySurface here, the drawable's
|
||||||
already gone.. But dri.c notices the window destruction and
|
already gone.. But dri.c notices the window destruction and
|
||||||
frees the surface itself. */
|
frees the surface itself. */
|
||||||
|
|
||||||
free(base);
|
/*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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
xfree(glxPriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __GLXdrawable *
|
static __GLXdrawable *
|
||||||
|
@ -1371,11 +1390,13 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen,
|
||||||
GLAQUA_DEBUG_MSG("glAquaScreenCreateDrawable(%p,%p,%d,%p)\n", context, pDraw, drawId, modes);
|
GLAQUA_DEBUG_MSG("glAquaScreenCreateDrawable(%p,%p,%d,%p)\n", context, pDraw, drawId, modes);
|
||||||
|
|
||||||
glxPriv = xalloc(sizeof *glxPriv);
|
glxPriv = xalloc(sizeof *glxPriv);
|
||||||
if (glxPriv == NULL) return NULL;
|
|
||||||
|
if(glxPriv == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
memset(glxPriv, 0, sizeof *glxPriv);
|
memset(glxPriv, 0, sizeof *glxPriv);
|
||||||
|
|
||||||
if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, drawId, conf)) {
|
if(!__glXDrawableInit(&glxPriv->base, screen, pDraw, type, drawId, conf)) {
|
||||||
xfree(glxPriv);
|
xfree(glxPriv);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1383,7 +1404,7 @@ __glXAquaScreenCreateDrawable(__GLXscreen *screen,
|
||||||
glxPriv->base.destroy = __glXAquaDrawableDestroy;
|
glxPriv->base.destroy = __glXAquaDrawableDestroy;
|
||||||
glxPriv->base.resize = __glXAquaDrawableResize;
|
glxPriv->base.resize = __glXAquaDrawableResize;
|
||||||
glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers;
|
glxPriv->base.swapBuffers = __glXAquaDrawableSwapBuffers;
|
||||||
// glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer;
|
glxPriv->base.copySubBuffer = __glXAquaDrawableCopySubBuffer;
|
||||||
|
|
||||||
return &glxPriv->base;
|
return &glxPriv->base;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue