From 7439a36785b6a2783e80a40a96c09db8f56dc2bc Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Wed, 6 Dec 2006 06:49:28 +0200 Subject: Clean and update XMesa/XFree86 interface. Drop XMesaSetVisualDisplay(), XMesaReset(), no longer used. Add XMesaCopyContext() and move the GlxSetRenderTables() call for XGL within XMesaForceCurrent(). This is to make xserver/GL/mesa/X/xf86glx.c unaware of Mesa internals. Also, clean some ifdef's to make it clear that USE_XSHM and XFree86Server are mutually exclusive. Lastly, - move gcstruct.h from glxheader.h up to xmesa_xf86.h since it calls *gc->ops - drop GL/glxtokens.h from xm_api|dd.c, GLX tokens come from glcore.h and are used irrelevant of XFree86. --- src/mesa/drivers/x11/xm_buffer.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/mesa/drivers/x11/xm_buffer.c') diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index bb8fe31ce8..10621cb7a1 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -37,7 +37,7 @@ #include "renderbuffer.h" -#ifndef XFree86Server +#if defined(USE_XSHM) && !defined(XFree86Server) static volatile int mesaXErrorFlag = 0; /** @@ -51,18 +51,14 @@ mesaHandleXError(XMesaDisplay *dpy, XErrorEvent *event) mesaXErrorFlag = 1; return 0; } -#endif - /** * Allocate a shared memory XImage back buffer for the given XMesaBuffer. * Return: GL_TRUE if success, GL_FALSE if error */ -#ifndef XFree86Server static GLboolean alloc_back_shm_ximage(XMesaBuffer b, GLuint width, GLuint height) { -#ifdef USE_XSHM /* * We have to do a _lot_ of error checking here to be sure we can * really use the XSHM extension. It seems different servers trigger @@ -152,10 +148,13 @@ alloc_back_shm_ximage(XMesaBuffer b, GLuint width, GLuint height) } return GL_TRUE; +} #else +static GLboolean +alloc_back_shm_ximage(XMesaBuffer b, GLuint width, GLuint height) +{ /* Can't compile XSHM support */ return GL_FALSE; -#endif } #endif @@ -187,14 +186,12 @@ alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height) return; /* Allocate new back buffer */ -#ifdef XFree86Server - /* Allocate a regular XImage for the back buffer. */ - b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel, - width, height, NULL); - { -#else if (b->shm == 0 || !alloc_back_shm_ximage(b, width, height)) { /* Allocate a regular XImage for the back buffer. */ +#ifdef XFree86Server + b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel, + width, height, NULL); +#else b->backxrb->ximage = XCreateImage(b->xm_visual->display, b->xm_visual->visinfo->visual, GET_VISUAL_DEPTH(b->xm_visual), -- cgit v1.2.3