summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Staplin <gstaplin@apple.com>2008-11-22 11:37:08 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-11-22 11:13:51 -0800
commit6eb33bc0cb2e62339d323e1f1894015d7e3142f3 (patch)
treef7bebe77fb8ab8f1b1cd9b97c2d49b62a6a202f4
parent429b4b20d5708d608fd55f91dd5bcd4ac0b51a12 (diff)
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)
-rw-r--r--hw/xquartz/GL/indirect.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 3cdb0122a..4de49355d 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -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) {
- 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
already gone.. But dri.c notices the window destruction and
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 *
@@ -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)) {
xfree(glxPriv);
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;
}