From 41bddcfa7bbc65bcd2fc60ada9761d3065e71388 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 12 Apr 2005 01:41:04 +0000 Subject: PF_8A8R8G8B pixel format (Dave Reveman) --- src/mesa/drivers/x11/xm_line.c | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src/mesa/drivers/x11/xm_line.c') diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c index ccb54a391cb..24e09ce344f 100644 --- a/src/mesa/drivers/x11/xm_line.c +++ b/src/mesa/drivers/x11/xm_line.c @@ -150,6 +150,23 @@ void xmesa_choose_point( GLcontext *ctx ) +/* + * Draw a flat-shaded, PF_8A8R8G8B line into an XImage. + */ +#define NAME flat_8A8R8G8B_line +#define SETUP_CODE \ + XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + const GLubyte *color = vert1->color; \ + GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] ); +#define PIXEL_TYPE GLuint +#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define CLIP_HACK 1 +#define PLOT(X,Y) *pixelPtr = pixel; +#include "swrast/s_linetemp.h" + + + /* * Draw a flat-shaded, PF_8R8G8B line into an XImage. */ @@ -321,6 +338,29 @@ void xmesa_choose_point( GLcontext *ctx ) +/* + * Draw a flat-shaded, Z-less, PF_8A8R8G8B line into an XImage. + */ +#define NAME flat_8A8R8G8B_z_line +#define SETUP_CODE \ + XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + const GLubyte *color = vert1->color; \ + GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] ); +#define INTERP_Z 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE +#define PIXEL_TYPE GLuint +#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define CLIP_HACK 1 +#define PLOT(X,Y) \ + if (Z < *zPtr) { \ + *zPtr = Z; \ + *pixelPtr = pixel; \ + } +#include "swrast/s_linetemp.h" + + + /* * Draw a flat-shaded, Z-less, PF_8R8G8B line into an XImage. */ @@ -511,6 +551,8 @@ static swrast_line_func get_line_func( GLcontext *ctx ) return flat_TRUECOLOR_z_line; case PF_8A8B8G8R: return flat_8A8B8G8R_z_line; + case PF_8A8R8G8B: + return flat_8A8R8G8B_z_line; case PF_8R8G8B: return flat_8R8G8B_z_line; case PF_8R8G8B24: @@ -537,6 +579,8 @@ static swrast_line_func get_line_func( GLcontext *ctx ) return flat_TRUECOLOR_line; case PF_8A8B8G8R: return flat_8A8B8G8R_line; + case PF_8A8R8G8B: + return flat_8A8R8G8B_line; case PF_8R8G8B: return flat_8R8G8B_line; case PF_8R8G8B24: -- cgit v1.2.3