xmesa: split FX functions to separate file, part 2.

This commit is contained in:
George Sapountzis
2007-04-20 18:25:42 +03:00
parent 4d944b502f
commit 6346a753c6
4 changed files with 32 additions and 15 deletions
+8 -13
View File
@@ -1557,12 +1557,11 @@ PUBLIC
void XMesaDestroyContext( XMesaContext c )
{
GLcontext *mesaCtx = &c->mesa;
#ifdef FX
XMesaBuffer xmbuf = XMESA_BUFFER(mesaCtx->DrawBuffer);
if (xmbuf && xmbuf->FXctx)
fxMesaDestroyContext(xmbuf->FXctx);
#ifdef FX
FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) );
#endif
_swsetup_DestroyContext( mesaCtx );
_swrast_DestroyContext( mesaCtx );
_tnl_DestroyContext( mesaCtx );
@@ -1767,15 +1766,6 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
if (!drawBuffer || !readBuffer)
return GL_FALSE; /* must specify buffers! */
#ifdef FX
if (drawBuffer->FXctx) {
fxMesaMakeCurrent(drawBuffer->FXctx);
c->xm_buffer = drawBuffer;
return GL_TRUE;
}
#endif
if (&(c->mesa) == _mesa_get_current_context()
&& c->mesa.DrawBuffer == &drawBuffer->mesa_buffer
&& c->mesa.ReadBuffer == &readBuffer->mesa_buffer
@@ -1786,6 +1776,11 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
c->xm_buffer = drawBuffer;
#ifdef FX
if (FXmakeCurrent( drawBuffer ))
return GL_TRUE;
#endif
/* Call this periodically to detect when the user has begun using
* GL rendering from multiple threads.
*/
+20 -1
View File
@@ -27,6 +27,8 @@
#include "xmesaP.h"
#ifdef FX
#include "../glide/fxdrv.h"
void
FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b)
{
@@ -109,6 +111,24 @@ FXcreateContext(XMesaVisual v, XMesaWindow w, XMesaContext c, XMesaBuffer b)
}
void FXdestroyContext( XMesaBuffer b )
{
if (b && b->FXctx)
fxMesaDestroyContext(b->FXctx);
}
GLboolean FXmakeCurrent( XMesaBuffer b )
{
if (b->FXctx) {
fxMesaMakeCurrent(b->FXctx);
return GL_TRUE;
}
return GL_FALSE;
}
/*
* Read image from VooDoo frame buffer into X/Mesa's back XImage.
*/
@@ -118,7 +138,6 @@ static void FXgetImage( XMesaBuffer b )
static unsigned short pixbuf[MAX_WIDTH];
GLuint x, y;
GLuint width, height;
XMesaContext xmesa = XMESA_CONTEXT(ctx);
#ifdef XFree86Server
x = b->frontxrb->pixmap->x;
+4
View File
@@ -31,6 +31,10 @@ extern void FXcreateContext( XMesaVisual v,
XMesaContext c,
XMesaBuffer b );
extern void FXdestroyContext( XMesaBuffer b );
extern GLboolean FXmakeCurrent( XMesaBuffer b );
extern GLboolean FXswapBuffers( XMesaBuffer b );
#endif /* _XM_GLIDE_H_ */
-1
View File
@@ -31,7 +31,6 @@
#include "mtypes.h"
#if defined(FX)
#include "GL/fxmesa.h"
#include "../glide/fxdrv.h"
#include "xm_glide.h"
#endif
#ifdef XFree86Server