From: Keith Whitwell Date: Thu, 8 Jan 2009 16:05:45 +0000 (+0000) Subject: xlib: strip out some unused XMesa api functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee2876316a541c7513cc902f106a00890c625f9f;p=mesa.git xlib: strip out some unused XMesa api functions --- diff --git a/src/gallium/state_trackers/xlib/fakeglx.c b/src/gallium/state_trackers/xlib/fakeglx.c index 04ba112b242..e62ff239d08 100644 --- a/src/gallium/state_trackers/xlib/fakeglx.c +++ b/src/gallium/state_trackers/xlib/fakeglx.c @@ -50,7 +50,6 @@ #include "mtypes.h" #include "version.h" #include "fakeglx.h" -#include "xmesaP.h" #include "state_tracker/st_context.h" #include "state_tracker/st_public.h" diff --git a/src/gallium/state_trackers/xlib/xm_api.c b/src/gallium/state_trackers/xlib/xm_api.c index b3c38bb0222..67a9a1ec8c8 100644 --- a/src/gallium/state_trackers/xlib/xm_api.c +++ b/src/gallium/state_trackers/xlib/xm_api.c @@ -59,7 +59,6 @@ #include "glxheader.h" #include "xm_api.h" -#include "xmesaP.h" #include "main/context.h" #include "main/framebuffer.h" @@ -1015,8 +1014,7 @@ XMesaDestroyBuffer(XMesaBuffer b) * and all attached renderbuffers. * Called when: * 1. the first time a buffer is bound to a context. - * 2. from the XMesaResizeBuffers() API function. - * 3. SwapBuffers. XXX probabaly from xm_flush_frontbuffer() too... + * 2. SwapBuffers. XXX probabaly from xm_flush_frontbuffer() too... * Note: it's possible (and legal) for xmctx to be NULL. That can happen * when resizing a buffer when no rendering context is bound. */ @@ -1100,30 +1098,6 @@ XMesaContext XMesaGetCurrentContext( void ) } -XMesaBuffer XMesaGetCurrentBuffer( void ) -{ - GET_CURRENT_CONTEXT(ctx); - if (ctx) { - XMesaBuffer xmbuf = xmesa_buffer(ctx->DrawBuffer); - return xmbuf; - } - else { - return 0; - } -} - - -/* New in Mesa 3.1 */ -XMesaBuffer XMesaGetCurrentReadBuffer( void ) -{ - GET_CURRENT_CONTEXT(ctx); - if (ctx) { - return xmesa_buffer(ctx->ReadBuffer); - } - else { - return 0; - } -} @@ -1176,25 +1150,6 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) -/* - * Return the depth buffer associated with an XMesaBuffer. - * Input: b - the XMesa buffer handle - * Output: width, height - size of buffer in pixels - * bytesPerValue - bytes per depth value (2 or 4) - * buffer - pointer to depth buffer values - * Return: GL_TRUE or GL_FALSE to indicate success or failure. - */ -GLboolean XMesaGetDepthBuffer( XMesaBuffer b, GLint *width, GLint *height, - GLint *bytesPerValue, void **buffer ) -{ - *width = 0; - *height = 0; - *bytesPerValue = 0; - *buffer = 0; - return GL_FALSE; -} - - void XMesaFlush( XMesaContext c ) { if (c && c->xm_visual->display) { @@ -1205,20 +1160,6 @@ void XMesaFlush( XMesaContext c ) -const char *XMesaGetString( XMesaContext c, int name ) -{ - (void) c; - if (name==XMESA_VERSION) { - return "5.0"; - } - else if (name==XMESA_EXTENSIONS) { - return ""; - } - else { - return NULL; - } -} - XMesaBuffer XMesaFindBuffer( Display *dpy, Drawable d ) @@ -1271,30 +1212,6 @@ void XMesaGarbageCollect( void ) } -unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y, - GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ) -{ - /* no longer supported */ - return 0; -} - - -/* - * This is typically called when the window size changes and we need - * to reallocate the buffer's back/depth/stencil/accum buffers. - */ -PUBLIC void -XMesaResizeBuffers( XMesaBuffer b ) -{ - GET_CURRENT_CONTEXT(ctx); - XMesaContext xmctx = xmesa_context(ctx); - if (!xmctx) - return; - xmesa_check_and_update_buffer_size(xmctx, b); -} - - PUBLIC void diff --git a/src/gallium/state_trackers/xlib/xm_api.h b/src/gallium/state_trackers/xlib/xm_api.h index d1f585e3299..33d2f2c522d 100644 --- a/src/gallium/state_trackers/xlib/xm_api.h +++ b/src/gallium/state_trackers/xlib/xm_api.h @@ -64,35 +64,6 @@ and create a window, you must do the following to use the X/Mesa interface: #ifndef XMESA_H #define XMESA_H -#ifdef __VMS -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include "GL/gl.h" - -#ifdef AMIWIN -#include -extern struct Library *XLibBase; -#endif - - -#define XMESA_MAJOR_VERSION 6 -#define XMESA_MINOR_VERSION 3 - - - -/* - * Values passed to XMesaGetString: - */ -#define XMESA_VERSION 1 -#define XMESA_EXTENSIONS 2 - typedef struct xmesa_context *XMesaContext; @@ -101,6 +72,9 @@ typedef struct xmesa_visual *XMesaVisual; typedef struct xmesa_buffer *XMesaBuffer; +/* Every user of this file also includes xmesaP.h + */ +#include "xmesaP.h" /* @@ -221,19 +195,6 @@ extern GLboolean XMesaUnbindContext( XMesaContext c ); extern XMesaContext XMesaGetCurrentContext( void ); -/* - * Return handle to the current (draw) buffer. - */ -extern XMesaBuffer XMesaGetCurrentBuffer( void ); - - -/* - * Return handle to the current read buffer. - * New in Mesa 3.3 - */ -extern XMesaBuffer XMesaGetCurrentReadBuffer( void ); - - /* * Swap the front and back buffers for the given buffer. No action is * taken if the buffer is not double buffered. @@ -253,37 +214,6 @@ extern void XMesaCopySubBuffer( XMesaBuffer b, int height ); -/* - * Return a pointer to the the Pixmap or XImage being used as the back - * color buffer of an XMesaBuffer. This function is a way to get "under - * the hood" of X/Mesa so one can manipulate the back buffer directly. - * Input: b - the XMesaBuffer - * Output: pixmap - pointer to back buffer's Pixmap, or 0 - * ximage - pointer to back buffer's XImage, or NULL - * Return: GL_TRUE = context is double buffered - * GL_FALSE = context is single buffered - */ -extern GLboolean XMesaGetBackBuffer( XMesaBuffer b, - Pixmap *pixmap, - XImage **ximage ); - - - -/* - * Return the depth buffer associated with an XMesaBuffer. - * Input: b - the XMesa buffer handle - * Output: width, height - size of buffer in pixels - * bytesPerValue - bytes per depth value (2 or 4) - * buffer - pointer to depth buffer values - * Return: GL_TRUE or GL_FALSE to indicate success or failure. - * - * New in Mesa 2.4. - */ -extern GLboolean XMesaGetDepthBuffer( XMesaBuffer b, - GLint *width, - GLint *height, - GLint *bytesPerValue, - void **buffer ); @@ -294,14 +224,6 @@ extern void XMesaFlush( XMesaContext c ); -/* - * Get an X/Mesa-specific string. - * Input: name - either XMESA_VERSION or XMESA_EXTENSIONS - */ -extern const char *XMesaGetString( XMesaContext c, int name ); - - - /* * Scan for XMesaBuffers whose window/pixmap has been destroyed, then free * any memory used by that buffer. @@ -312,36 +234,6 @@ extern void XMesaGarbageCollect( void ); -/* - * Return a dithered pixel value. - * Input: c - XMesaContext - * x, y - window coordinate - * red, green, blue, alpha - color components in [0,1] - * Return: pixel value - * - * New in Mesa 2.3. - */ -extern unsigned long XMesaDitherColor( XMesaContext xmesa, - GLint x, - GLint y, - GLfloat red, - GLfloat green, - GLfloat blue, - GLfloat alpha ); - - - - -/* - * Reallocate the back/depth/stencil/accum/etc/ buffers associated with - * buffer if its size has changed. - * - * New in Mesa 4.0.2 - */ -extern void XMesaResizeBuffers( XMesaBuffer b ); - - - /* * Create a pbuffer. * New in Mesa 4.1 @@ -370,9 +262,5 @@ XMesaCreatePixmapTextureBuffer(XMesaVisual v, Pixmap p, -#ifdef __cplusplus -} -#endif - #endif