diff options
author | Keith Whitwell <[email protected]> | 2001-03-19 02:25:35 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2001-03-19 02:25:35 +0000 |
commit | 709892459922a32096fe9dd8261d0d92337bb02f (patch) | |
tree | 87782215d4531207c97b236a5dfa0d15c45aef8a /src/mesa/drivers/x11 | |
parent | d9bf6ccce9f5fea22d6a478c4afafea3c3c525c5 (diff) |
Split driver struct into swrast/tnl/core components.
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r-- | src/mesa/drivers/x11/xm_api.c | 13 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_dd.c | 68 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xm_span.c | 309 | ||||
-rw-r--r-- | src/mesa/drivers/x11/xmesaP.h | 5 |
4 files changed, 209 insertions, 186 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index abbec2d7dd1..96dfc4bfe47 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1,4 +1,4 @@ -/* $Id: xm_api.c,v 1.18 2001/03/08 15:23:46 brianp Exp $ */ +/* $Id: xm_api.c,v 1.19 2001/03/19 02:25:36 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -1659,10 +1659,6 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) c->driContextPriv = driContextPriv; #endif - /* Set up some constant pointers: - */ - xmesa_init_pointers( ctx ); - /* Initialize the software rasterizer and helper modules. */ _swrast_CreateContext( ctx ); @@ -1672,6 +1668,11 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) xmesa_register_swrast_functions( ctx ); + /* Set up some constant pointers: + */ + xmesa_init_pointers( ctx ); + + /* Run the config file */ _mesa_context_initialize( ctx ); @@ -1692,6 +1693,8 @@ void XMesaDestroyContext( XMesaContext c ) if (c->gl_ctx) { _swsetup_DestroyContext( c->gl_ctx ); _swrast_DestroyContext( c->gl_ctx ); + _tnl_DestroyContext( c->gl_ctx ); + _ac_DestroyContext( c->gl_ctx ); _mesa_destroy_context( c->gl_ctx ); } diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index a73b3c69735..2bb04ae5044 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1,4 +1,4 @@ -/* $Id: xm_dd.c,v 1.18 2001/03/03 20:33:30 brianp Exp $ */ +/* $Id: xm_dd.c,v 1.19 2001/03/19 02:25:36 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -41,6 +41,7 @@ #include "swrast/s_alphabuf.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" +#include "tnl/t_context.h" /* @@ -181,8 +182,8 @@ set_draw_buffer( GLcontext *ctx, GLenum mode ) } -static void -set_read_buffer( GLcontext *ctx, GLframebuffer *buffer, GLenum mode ) +void +xmesa_set_read_buffer( GLcontext *ctx, GLframebuffer *buffer, GLenum mode ) { XMesaBuffer target; const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; @@ -933,27 +934,13 @@ void xmesa_update_state( GLcontext *ctx, GLuint new_state ) */ void xmesa_init_pointers( GLcontext *ctx ) { + TNLcontext *tnl; + ctx->Driver.GetString = get_string; ctx->Driver.GetBufferSize = get_buffer_size; ctx->Driver.Flush = flush; ctx->Driver.Finish = finish; - - /* Hooks for t_vb_render.c: - */ - ctx->Driver.RenderStart = _swsetup_RenderStart; - ctx->Driver.RenderFinish = _swsetup_RenderFinish; - ctx->Driver.BuildProjectedVertices = _swsetup_BuildProjectedVertices; - ctx->Driver.RenderPrimitive = _swsetup_RenderPrimitive; - ctx->Driver.PointsFunc = _swsetup_Points; - ctx->Driver.LineFunc = _swsetup_Line; - ctx->Driver.TriangleFunc = _swsetup_Triangle; - ctx->Driver.QuadFunc = _swsetup_Quad; - ctx->Driver.ResetLineStipple = _swrast_ResetLineStipple; - ctx->Driver.RenderInterp = _swsetup_RenderInterp; - ctx->Driver.RenderCopyPV = _swsetup_RenderCopyPV; - ctx->Driver.RenderClippedLine = _swsetup_RenderClippedLine; - ctx->Driver.RenderClippedPolygon = _swsetup_RenderClippedPolygon; - + /* Software rasterizer pixel paths: */ ctx->Driver.Accum = _swrast_Accum; @@ -972,22 +959,49 @@ void xmesa_init_pointers( GLcontext *ctx ) ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.CopyTexImage1D = _mesa_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _mesa_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _mesa_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _mesa_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _mesa_copy_texsubimage3d; ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - /* + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + + + /* Swrast hooks for imaging extensions: + */ + ctx->Driver.CopyColorTable = _swrast_CopyColorTable; + ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; + ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + + + /* Statechange callbacks: */ ctx->Driver.SetDrawBuffer = set_draw_buffer; - ctx->Driver.SetReadBuffer = set_read_buffer; ctx->Driver.ClearIndex = clear_index; ctx->Driver.ClearColor = clear_color; ctx->Driver.IndexMask = index_mask; ctx->Driver.ColorMask = color_mask; ctx->Driver.Enable = enable; + + /* Initialize the TNL driver interface: + */ + tnl = TNL_CONTEXT(ctx); + tnl->Driver.RenderStart = _swsetup_RenderStart; + tnl->Driver.RenderFinish = _swsetup_RenderFinish; + tnl->Driver.BuildProjectedVertices = _swsetup_BuildProjectedVertices; + tnl->Driver.RenderPrimitive = _swsetup_RenderPrimitive; + tnl->Driver.PointsFunc = _swsetup_Points; + tnl->Driver.LineFunc = _swsetup_Line; + tnl->Driver.TriangleFunc = _swsetup_Triangle; + tnl->Driver.QuadFunc = _swsetup_Quad; + tnl->Driver.ResetLineStipple = _swrast_ResetLineStipple; + tnl->Driver.RenderInterp = _swsetup_RenderInterp; + tnl->Driver.RenderCopyPV = _swsetup_RenderCopyPV; + tnl->Driver.RenderClippedLine = _swsetup_RenderClippedLine; + tnl->Driver.RenderClippedPolygon = _swsetup_RenderClippedPolygon; + (void) DitherValues; /* silenced unused var warning */ } diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index e87fd98a8a5..0991a44f7e9 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -1,4 +1,4 @@ -/* $Id: xm_span.c,v 1.10 2001/03/03 20:33:30 brianp Exp $ */ +/* $Id: xm_span.c,v 1.11 2001/03/19 02:25:36 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -36,7 +36,7 @@ #include "xmesaP.h" #include "extensions.h" - +#include "swrast/swrast.h" /* @@ -4236,6 +4236,7 @@ void xmesa_update_span_funcs( GLcontext *ctx ) { XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; int depth=GET_VISUAL_DEPTH(xmesa->xm_visual); + struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference( ctx ); /* * These drawing functions depend on color buffer config: @@ -4244,98 +4245,98 @@ void xmesa_update_span_funcs( GLcontext *ctx ) /* Writing to window or back pixmap */ switch (xmesa->pixelformat) { case PF_INDEX: - ctx->Driver.WriteCI32Span = write_span_index_pixmap; - ctx->Driver.WriteCI8Span = write_span_index8_pixmap; - ctx->Driver.WriteMonoCISpan = write_span_mono_index_pixmap; - ctx->Driver.WriteCI32Pixels = write_pixels_index_pixmap; - ctx->Driver.WriteMonoCIPixels = write_pixels_mono_index_pixmap; + dd->WriteCI32Span = write_span_index_pixmap; + dd->WriteCI8Span = write_span_index8_pixmap; + dd->WriteMonoCISpan = write_span_mono_index_pixmap; + dd->WriteCI32Pixels = write_pixels_index_pixmap; + dd->WriteMonoCIPixels = write_pixels_mono_index_pixmap; break; case PF_TRUECOLOR: - ctx->Driver.WriteRGBASpan = write_span_TRUECOLOR_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_TRUECOLOR_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_TRUECOLOR_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap; + dd->WriteRGBASpan = write_span_TRUECOLOR_pixmap; + dd->WriteRGBSpan = write_span_rgb_TRUECOLOR_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_TRUECOLOR_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; break; case PF_TRUEDITHER: - ctx->Driver.WriteRGBASpan = write_span_TRUEDITHER_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_TRUEDITHER_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_TRUEDITHER_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_TRUEDITHER_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_pixmap; + dd->WriteRGBASpan = write_span_TRUEDITHER_pixmap; + dd->WriteRGBSpan = write_span_rgb_TRUEDITHER_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_TRUEDITHER_pixmap; + dd->WriteRGBAPixels = write_pixels_TRUEDITHER_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_pixmap; break; case PF_8A8B8G8R: - ctx->Driver.WriteRGBASpan = write_span_8A8B8G8R_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_8A8B8G8R_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_8A8B8G8R_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap; + dd->WriteRGBASpan = write_span_8A8B8G8R_pixmap; + dd->WriteRGBSpan = write_span_rgb_8A8B8G8R_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_8A8B8G8R_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; break; case PF_8R8G8B: - ctx->Driver.WriteRGBASpan = write_span_8R8G8B_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_8R8G8B_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_8R8G8B_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap; + dd->WriteRGBASpan = write_span_8R8G8B_pixmap; + dd->WriteRGBSpan = write_span_rgb_8R8G8B_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_8R8G8B_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; break; case PF_8R8G8B24: - ctx->Driver.WriteRGBASpan = write_span_8R8G8B24_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_8R8G8B24_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_8R8G8B24_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap; + dd->WriteRGBASpan = write_span_8R8G8B24_pixmap; + dd->WriteRGBSpan = write_span_rgb_8R8G8B24_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_8R8G8B24_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; break; case PF_5R6G5B: - ctx->Driver.WriteRGBASpan = write_span_5R6G5B_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_5R6G5B_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_5R6G5B_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap; + dd->WriteRGBASpan = write_span_5R6G5B_pixmap; + dd->WriteRGBSpan = write_span_rgb_5R6G5B_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_5R6G5B_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; break; case PF_DITHER_5R6G5B: - ctx->Driver.WriteRGBASpan = write_span_DITHER_5R6G5B_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_DITHER_5R6G5B_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_TRUEDITHER_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_DITHER_5R6G5B_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_pixmap; + dd->WriteRGBASpan = write_span_DITHER_5R6G5B_pixmap; + dd->WriteRGBSpan = write_span_rgb_DITHER_5R6G5B_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_TRUEDITHER_pixmap; + dd->WriteRGBAPixels = write_pixels_DITHER_5R6G5B_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_pixmap; break; case PF_DITHER: - ctx->Driver.WriteRGBASpan = write_span_DITHER_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_DITHER_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_DITHER_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_DITHER_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_DITHER_pixmap; + dd->WriteRGBASpan = write_span_DITHER_pixmap; + dd->WriteRGBSpan = write_span_rgb_DITHER_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_DITHER_pixmap; + dd->WriteRGBAPixels = write_pixels_DITHER_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER_pixmap; break; case PF_1BIT: - ctx->Driver.WriteRGBASpan = write_span_1BIT_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_1BIT_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_1BIT_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_1BIT_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_1BIT_pixmap; + dd->WriteRGBASpan = write_span_1BIT_pixmap; + dd->WriteRGBSpan = write_span_rgb_1BIT_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_1BIT_pixmap; + dd->WriteRGBAPixels = write_pixels_1BIT_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_1BIT_pixmap; break; case PF_HPCR: - ctx->Driver.WriteRGBASpan = write_span_HPCR_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_HPCR_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_HPCR_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap; + dd->WriteRGBASpan = write_span_HPCR_pixmap; + dd->WriteRGBSpan = write_span_rgb_HPCR_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_HPCR_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; if (xmesa->xm_visual->hpcr_clear_flag) { - ctx->Driver.ClearColor = clear_color_HPCR_pixmap; + ctx->Driver.ClearColor = clear_color_HPCR_pixmap; } break; case PF_LOOKUP: - ctx->Driver.WriteRGBASpan = write_span_LOOKUP_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_LOOKUP_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_LOOKUP_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap; + dd->WriteRGBASpan = write_span_LOOKUP_pixmap; + dd->WriteRGBSpan = write_span_rgb_LOOKUP_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_LOOKUP_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; break; case PF_GRAYSCALE: - ctx->Driver.WriteRGBASpan = write_span_GRAYSCALE_pixmap; - ctx->Driver.WriteRGBSpan = write_span_rgb_GRAYSCALE_pixmap; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_pixmap; - ctx->Driver.WriteRGBAPixels = write_pixels_GRAYSCALE_pixmap; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_pixmap; + dd->WriteRGBASpan = write_span_GRAYSCALE_pixmap; + dd->WriteRGBSpan = write_span_rgb_GRAYSCALE_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_GRAYSCALE_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; break; default: _mesa_problem(NULL,"Bad pixel format in xmesa_update_state (1)"); @@ -4346,128 +4347,128 @@ void xmesa_update_span_funcs( GLcontext *ctx ) /* Writing to back XImage */ switch (xmesa->pixelformat) { case PF_INDEX: - ctx->Driver.WriteCI32Span = write_span_index_ximage; + dd->WriteCI32Span = write_span_index_ximage; if (depth==8) - ctx->Driver.WriteCI8Span = write_span_index8_ximage8; + dd->WriteCI8Span = write_span_index8_ximage8; else - ctx->Driver.WriteCI8Span = write_span_index8_ximage; - ctx->Driver.WriteMonoCISpan = write_span_mono_index_ximage; - ctx->Driver.WriteCI32Pixels = write_pixels_index_ximage; - ctx->Driver.WriteMonoCIPixels = write_pixels_mono_index_ximage; + dd->WriteCI8Span = write_span_index8_ximage; + dd->WriteMonoCISpan = write_span_mono_index_ximage; + dd->WriteCI32Pixels = write_pixels_index_ximage; + dd->WriteMonoCIPixels = write_pixels_mono_index_ximage; break; case PF_TRUECOLOR: /* Generic RGB */ - ctx->Driver.WriteRGBASpan = write_span_TRUECOLOR_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_TRUECOLOR_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_TRUECOLOR_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_ximage; + dd->WriteRGBASpan = write_span_TRUECOLOR_ximage; + dd->WriteRGBSpan = write_span_rgb_TRUECOLOR_ximage; + dd->WriteMonoRGBASpan = write_span_mono_ximage; + dd->WriteRGBAPixels = write_pixels_TRUECOLOR_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_ximage; break; case PF_TRUEDITHER: - ctx->Driver.WriteRGBASpan = write_span_TRUEDITHER_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_TRUEDITHER_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_TRUEDITHER_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_TRUEDITHER_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_ximage; + dd->WriteRGBASpan = write_span_TRUEDITHER_ximage; + dd->WriteRGBSpan = write_span_rgb_TRUEDITHER_ximage; + dd->WriteMonoRGBASpan = write_span_mono_TRUEDITHER_ximage; + dd->WriteRGBAPixels = write_pixels_TRUEDITHER_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_ximage; break; case PF_8A8B8G8R: - ctx->Driver.WriteRGBASpan = write_span_8A8B8G8R_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_8A8B8G8R_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_8A8B8G8R_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_8A8B8G8R_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_8A8B8G8R_ximage; + dd->WriteRGBASpan = write_span_8A8B8G8R_ximage; + dd->WriteRGBSpan = write_span_rgb_8A8B8G8R_ximage; + dd->WriteMonoRGBASpan = write_span_mono_8A8B8G8R_ximage; + dd->WriteRGBAPixels = write_pixels_8A8B8G8R_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_8A8B8G8R_ximage; break; case PF_8R8G8B: - ctx->Driver.WriteRGBASpan = write_span_8R8G8B_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_8R8G8B_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_8R8G8B_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_8R8G8B_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_8R8G8B_ximage; + dd->WriteRGBASpan = write_span_8R8G8B_ximage; + dd->WriteRGBSpan = write_span_rgb_8R8G8B_ximage; + dd->WriteMonoRGBASpan = write_span_mono_8R8G8B_ximage; + dd->WriteRGBAPixels = write_pixels_8R8G8B_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_8R8G8B_ximage; break; case PF_8R8G8B24: - ctx->Driver.WriteRGBASpan = write_span_8R8G8B24_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_8R8G8B24_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_8R8G8B24_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_8R8G8B24_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_8R8G8B24_ximage; + dd->WriteRGBASpan = write_span_8R8G8B24_ximage; + dd->WriteRGBSpan = write_span_rgb_8R8G8B24_ximage; + dd->WriteMonoRGBASpan = write_span_mono_8R8G8B24_ximage; + dd->WriteRGBAPixels = write_pixels_8R8G8B24_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_8R8G8B24_ximage; break; case PF_5R6G5B: - ctx->Driver.WriteRGBASpan = write_span_5R6G5B_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_5R6G5B_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_5R6G5B_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_ximage; + dd->WriteRGBASpan = write_span_5R6G5B_ximage; + dd->WriteRGBSpan = write_span_rgb_5R6G5B_ximage; + dd->WriteMonoRGBASpan = write_span_mono_ximage; + dd->WriteRGBAPixels = write_pixels_5R6G5B_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_ximage; break; case PF_DITHER_5R6G5B: - ctx->Driver.WriteRGBASpan = write_span_DITHER_5R6G5B_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_DITHER_5R6G5B_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_DITHER_5R6G5B_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_DITHER_5R6G5B_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_DITHER_5R6G5B_ximage; + dd->WriteRGBASpan = write_span_DITHER_5R6G5B_ximage; + dd->WriteRGBSpan = write_span_rgb_DITHER_5R6G5B_ximage; + dd->WriteMonoRGBASpan = write_span_mono_DITHER_5R6G5B_ximage; + dd->WriteRGBAPixels = write_pixels_DITHER_5R6G5B_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER_5R6G5B_ximage; break; case PF_DITHER: if (depth==8) { - ctx->Driver.WriteRGBASpan = write_span_DITHER8_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_DITHER8_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_DITHER8_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_DITHER8_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_DITHER8_ximage; + dd->WriteRGBASpan = write_span_DITHER8_ximage; + dd->WriteRGBSpan = write_span_rgb_DITHER8_ximage; + dd->WriteMonoRGBASpan = write_span_mono_DITHER8_ximage; + dd->WriteRGBAPixels = write_pixels_DITHER8_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER8_ximage; } else { - ctx->Driver.WriteRGBASpan = write_span_DITHER_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_DITHER_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_DITHER_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_DITHER_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_DITHER_ximage; + dd->WriteRGBASpan = write_span_DITHER_ximage; + dd->WriteRGBSpan = write_span_rgb_DITHER_ximage; + dd->WriteMonoRGBASpan = write_span_mono_DITHER_ximage; + dd->WriteRGBAPixels = write_pixels_DITHER_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER_ximage; } break; case PF_1BIT: - ctx->Driver.WriteRGBASpan = write_span_1BIT_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_1BIT_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_1BIT_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_1BIT_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_1BIT_ximage; + dd->WriteRGBASpan = write_span_1BIT_ximage; + dd->WriteRGBSpan = write_span_rgb_1BIT_ximage; + dd->WriteMonoRGBASpan = write_span_mono_1BIT_ximage; + dd->WriteRGBAPixels = write_pixels_1BIT_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_1BIT_ximage; break; case PF_HPCR: - ctx->Driver.WriteRGBASpan = write_span_HPCR_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_HPCR_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_HPCR_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_HPCR_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_HPCR_ximage; + dd->WriteRGBASpan = write_span_HPCR_ximage; + dd->WriteRGBSpan = write_span_rgb_HPCR_ximage; + dd->WriteMonoRGBASpan = write_span_mono_HPCR_ximage; + dd->WriteRGBAPixels = write_pixels_HPCR_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_HPCR_ximage; if (xmesa->xm_visual->hpcr_clear_flag) { ctx->Driver.ClearColor = clear_color_HPCR_ximage; } break; case PF_LOOKUP: if (depth==8) { - ctx->Driver.WriteRGBASpan = write_span_LOOKUP8_ximage; - ctx->Driver.WriteRGBSpan = write_rgb_LOOKUP8_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_LOOKUP8_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_LOOKUP8_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_LOOKUP8_ximage; + dd->WriteRGBASpan = write_span_LOOKUP8_ximage; + dd->WriteRGBSpan = write_rgb_LOOKUP8_ximage; + dd->WriteMonoRGBASpan = write_span_mono_LOOKUP8_ximage; + dd->WriteRGBAPixels = write_pixels_LOOKUP8_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_LOOKUP8_ximage; } else { - ctx->Driver.WriteRGBASpan = write_span_LOOKUP_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_LOOKUP_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_LOOKUP_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_ximage; + dd->WriteRGBASpan = write_span_LOOKUP_ximage; + dd->WriteRGBSpan = write_span_rgb_LOOKUP_ximage; + dd->WriteMonoRGBASpan = write_span_mono_ximage; + dd->WriteRGBAPixels = write_pixels_LOOKUP_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_ximage; } break; case PF_GRAYSCALE: if (depth==8) { - ctx->Driver.WriteRGBASpan = write_span_GRAYSCALE8_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_GRAYSCALE8_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_GRAYSCALE8_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_GRAYSCALE8_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_GRAYSCALE8_ximage; + dd->WriteRGBASpan = write_span_GRAYSCALE8_ximage; + dd->WriteRGBSpan = write_span_rgb_GRAYSCALE8_ximage; + dd->WriteMonoRGBASpan = write_span_mono_GRAYSCALE8_ximage; + dd->WriteRGBAPixels = write_pixels_GRAYSCALE8_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_GRAYSCALE8_ximage; } else { - ctx->Driver.WriteRGBASpan = write_span_GRAYSCALE_ximage; - ctx->Driver.WriteRGBSpan = write_span_rgb_GRAYSCALE_ximage; - ctx->Driver.WriteMonoRGBASpan = write_span_mono_ximage; - ctx->Driver.WriteRGBAPixels = write_pixels_GRAYSCALE_ximage; - ctx->Driver.WriteMonoRGBAPixels = write_pixels_mono_ximage; + dd->WriteRGBASpan = write_span_GRAYSCALE_ximage; + dd->WriteRGBSpan = write_span_rgb_GRAYSCALE_ximage; + dd->WriteMonoRGBASpan = write_span_mono_ximage; + dd->WriteRGBAPixels = write_pixels_GRAYSCALE_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_ximage; } break; default: @@ -4477,8 +4478,10 @@ void xmesa_update_span_funcs( GLcontext *ctx ) } /* Pixel/span reading functions: */ - ctx->Driver.ReadCI32Span = read_index_span; - ctx->Driver.ReadRGBASpan = read_color_span; - ctx->Driver.ReadCI32Pixels = read_index_pixels; - ctx->Driver.ReadRGBAPixels = read_color_pixels; + dd->ReadCI32Span = read_index_span; + dd->ReadRGBASpan = read_color_span; + dd->ReadCI32Pixels = read_index_pixels; + dd->ReadRGBAPixels = read_color_pixels; + + dd->SetReadBuffer = xmesa_set_read_buffer; } diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 8aa8a47b14f..34d07c9e820 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -1,4 +1,4 @@ -/* $Id: xmesaP.h,v 1.19 2001/01/08 04:06:20 keithw Exp $ */ +/* $Id: xmesaP.h,v 1.20 2001/03/19 02:25:36 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -551,4 +551,7 @@ extern GLboolean XMesaForceCurrent(XMesaContext c); extern GLboolean XMesaLoseCurrent(XMesaContext c); extern void XMesaReset( void ); +extern void xmesa_set_read_buffer( GLcontext *ctx, + GLframebuffer *buffer, GLenum mode ); + #endif |