remove DitherValues
[mesa.git] / src / mesa / drivers / x11 / xm_line.c
index e9bbfbca41750b0375aeb602f217c380a1a48eaf..a5352d614747883828dc1fd861565cacd8f5eec1 100644 (file)
@@ -1,10 +1,9 @@
-/* $Id: xm_line.c,v 1.15 2001/01/05 02:26:48 keithw Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  5.1
  *
- * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -35,7 +34,6 @@
 #include "glxheader.h"
 #include "depth.h"
 #include "macros.h"
-#include "mmath.h"
 #include "mtypes.h"
 #include "xmesaP.h"
 
 /* XXX don't use this, it doesn't dither correctly */
 static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert )
 {
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);
    XMesaDisplay *dpy = xmesa->xm_visual->display;
    XMesaDrawable buffer = xmesa->xm_buffer->buffer;
    XMesaGC gc = xmesa->xm_buffer->gc;
 
-   if (xmesa->xm_visual->gl_visual->RGBAflag) {
+   if (xmesa->xm_visual->mesa_visual.RGBAflag) {
       register int x, y;
       const GLubyte *color = vert->color;
       unsigned long pixel = xmesa_color_to_pixel( xmesa,
@@ -95,13 +93,13 @@ static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert )
 void xmesa_choose_point( GLcontext *ctx )
 {
 #if 0
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
 
    if (ctx->RenderMode == GL_RENDER
        && ctx->Point.Size == 1.0F && !ctx->Point.SmoothFlag
        && swrast->_RasterMask == 0
-       && !ctx->Texture._ReallyEnabled
+       && !ctx->Texture._EnabledUnits
        && xmesa->xm_buffer->buffer != XIMAGE) {
       swrast->Point = draw_points_ANY_pixmap;
    }
@@ -123,73 +121,60 @@ void xmesa_choose_point( GLcontext *ctx )
 /*
  * Draw a flat-shaded, PF_TRUECOLOR line into an XImage.
  */
-static void flat_TRUECOLOR_line( GLcontext *ctx,
-                                 const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
-   XMesaImage *img = xmesa->xm_buffer->backimage;
-   unsigned long pixel;
+#define NAME flat_TRUECOLOR_line
+#define SETUP_CODE                                     \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);            \
+   const GLubyte *color = vert1->color;                        \
+   XMesaImage *img = xmesa->xm_buffer->backimage;      \
+   unsigned long pixel;                                        \
    PACK_TRUECOLOR( pixel, color[0], color[1], color[2] );
-
-#define INTERP_XY 1
 #define CLIP_HACK 1
 #define PLOT(X,Y) XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel );
-
 #include "swrast/s_linetemp.h"
-}
 
 
 
 /*
  * Draw a flat-shaded, PF_8A8B8G8R line into an XImage.
  */
-static void flat_8A8B8G8R_line( GLcontext *ctx,
-                                const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
+#define NAME flat_8A8B8G8R_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
    GLuint pixel = PACK_8B8G8R( 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.
  */
-static void flat_8R8G8B_line( GLcontext *ctx,
-                              const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
+#define NAME flat_8R8G8B_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_8R8G8B24 line into an XImage.
  */
-static void flat_8R8G8B24_line( GLcontext *ctx,
-                              const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_8R8G8B24_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
    const GLubyte *color = vert1->color;
-
 #define PIXEL_TYPE bgr_t
 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
 #define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
@@ -199,130 +184,109 @@ static void flat_8R8G8B24_line( GLcontext *ctx,
       pixelPtr->g = color[GCOMP];      \
       pixelPtr->b = color[BCOMP];      \
 }
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, PF_5R6G5B line into an XImage.
  */
-static void flat_5R6G5B_line( GLcontext *ctx,
-                              const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
+#define NAME flat_5R6G5B_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
    GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] );
-
 #define PIXEL_TYPE GLushort
 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(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_DITHER_5R6G5B line into an XImage.
  */
-static void flat_DITHER_5R6G5B_line( GLcontext *ctx,
-                                     const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_DITHER_5R6G5B_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
    const GLubyte *color = vert1->color;
-
 #define PIXEL_TYPE GLushort
 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
 #define CLIP_HACK 1
 #define PLOT(X,Y) PACK_TRUEDITHER( *pixelPtr, X, Y, color[0], color[1], color[2] );
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 
 /*
  * Draw a flat-shaded, PF_DITHER 8-bit line into an XImage.
  */
-static void flat_DITHER8_line( GLcontext *ctx,
-                               const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
-   GLint r = color[0], g = color[1], b = color[2];
+#define NAME flat_DITHER8_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
+   GLint r = color[0], g = color[1], b = color[2];             \
    DITHER_SETUP;
-
-#define INTERP_XY 1
 #define PIXEL_TYPE GLubyte
 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
 #define CLIP_HACK 1
 #define PLOT(X,Y) *pixelPtr = DITHER(X,Y,r,g,b);
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, PF_LOOKUP 8-bit line into an XImage.
  */
-static void flat_LOOKUP8_line( GLcontext *ctx,
-                               const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
-   GLubyte pixel;
-   LOOKUP_SETUP;
+#define NAME flat_LOOKUP8_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
+   GLubyte pixel;                                              \
+   LOOKUP_SETUP;                                               \
    pixel = (GLubyte) LOOKUP( color[0], color[1], color[2] );
-
 #define PIXEL_TYPE GLubyte
 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(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_HPCR line into an XImage.
  */
-static void flat_HPCR_line( GLcontext *ctx,
-                            const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
+#define NAME flat_HPCR_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
    GLint r = color[0], g = color[1], b = color[2];
-
-#define INTERP_XY 1
 #define PIXEL_TYPE GLubyte
 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
 #define CLIP_HACK 1
 #define PLOT(X,Y) *pixelPtr = (GLubyte) DITHER_HPCR(X,Y,r,g,b);
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 
 /*
  * Draw a flat-shaded, Z-less, PF_TRUECOLOR line into an XImage.
  */
-static void flat_TRUECOLOR_z_line( GLcontext *ctx,
-                                   const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
-   XMesaImage *img = xmesa->xm_buffer->backimage;
-   unsigned long pixel;
+#define NAME flat_TRUECOLOR_z_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
+   XMesaImage *img = xmesa->xm_buffer->backimage;              \
+   unsigned long pixel;                                                \
    PACK_TRUECOLOR( pixel, color[0], color[1], color[2] );
-
-#define INTERP_XY 1
 #define INTERP_Z 1
 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
 #define CLIP_HACK 1
@@ -331,21 +295,18 @@ static void flat_TRUECOLOR_z_line( GLcontext *ctx,
           *zPtr = Z;                                                   \
            XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel );  \
        }
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, Z-less, PF_8A8B8G8R line into an XImage.
  */
-static void flat_8A8B8G8R_z_line( GLcontext *ctx,
-                                  const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
+#define NAME flat_8A8B8G8R_z_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
    GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] );
-
 #define INTERP_Z 1
 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
 #define PIXEL_TYPE GLuint
@@ -357,21 +318,18 @@ static void flat_8A8B8G8R_z_line( GLcontext *ctx,
           *zPtr = Z;           \
           *pixelPtr = pixel;   \
        }
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, Z-less, PF_8R8G8B line into an XImage.
  */
-static void flat_8R8G8B_z_line( GLcontext *ctx,
-                                const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
+#define NAME flat_8R8G8B_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
@@ -383,20 +341,17 @@ static void flat_8R8G8B_z_line( GLcontext *ctx,
           *zPtr = Z;           \
           *pixelPtr = pixel;   \
        }
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, Z-less, PF_8R8G8B24 line into an XImage.
  */
-static void flat_8R8G8B24_z_line( GLcontext *ctx,
-                                    const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_8R8G8B24_z_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
    const GLubyte *color = vert1->color;
-
 #define INTERP_Z 1
 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
 #define PIXEL_TYPE bgr_t
@@ -410,21 +365,18 @@ static void flat_8R8G8B24_z_line( GLcontext *ctx,
            pixelPtr->g = color[GCOMP]; \
            pixelPtr->b = color[BCOMP]; \
        }
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, Z-less, PF_5R6G5B line into an XImage.
  */
-static void flat_5R6G5B_z_line( GLcontext *ctx,
-                                const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
+#define NAME flat_5R6G5B_z_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
    GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] );
-
 #define INTERP_Z 1
 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
 #define PIXEL_TYPE GLushort
@@ -437,18 +389,16 @@ static void flat_5R6G5B_z_line( GLcontext *ctx,
           *pixelPtr = pixel;   \
        }
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, Z-less, PF_DITHER_5R6G5B line into an XImage.
  */
-static void flat_DITHER_5R6G5B_z_line( GLcontext *ctx,
-                                       const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+#define NAME flat_DITHER_5R6G5B_z_line
+#define SETUP_CODE                                     \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);            \
    const GLubyte *color = vert1->color;
-
 #define INTERP_Z 1
 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
 #define PIXEL_TYPE GLushort
@@ -461,21 +411,18 @@ static void flat_DITHER_5R6G5B_z_line( GLcontext *ctx,
           PACK_TRUEDITHER(*pixelPtr, X, Y, color[0], color[1], color[2]); \
        }
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, Z-less, PF_DITHER 8-bit line into an XImage.
  */
-static void flat_DITHER8_z_line( GLcontext *ctx,
-                                 const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
-   GLint r = color[0], g = color[1], b = color[2];
+#define NAME flat_DITHER8_z_line
+#define SETUP_CODE                                     \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);            \
+   const GLubyte *color = vert1->color;                        \
+   GLint r = color[0], g = color[1], b = color[2];     \
    DITHER_SETUP;
-
-#define INTERP_XY 1
 #define INTERP_Z 1
 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
 #define PIXEL_TYPE GLubyte
@@ -488,21 +435,19 @@ static void flat_DITHER8_z_line( GLcontext *ctx,
           *pixelPtr = (GLubyte) DITHER( X, Y, r, g, b);        \
        }
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, Z-less, PF_LOOKUP 8-bit line into an XImage.
  */
-static void flat_LOOKUP8_z_line( GLcontext *ctx,
-                                 const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
-   GLubyte pixel;
-   LOOKUP_SETUP;
+#define NAME flat_LOOKUP8_z_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
+   GLubyte pixel;                                              \
+   LOOKUP_SETUP;                                               \
    pixel = (GLubyte) LOOKUP( color[0], color[1], color[2] );
-
 #define INTERP_Z 1
 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
 #define PIXEL_TYPE GLubyte
@@ -514,22 +459,18 @@ static void flat_LOOKUP8_z_line( GLcontext *ctx,
           *zPtr = Z;           \
           *pixelPtr = pixel;   \
        }
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 /*
  * Draw a flat-shaded, Z-less, PF_HPCR line into an XImage.
  */
-static void flat_HPCR_z_line( GLcontext *ctx,
-                              const SWvertex *vert0, const SWvertex *vert1 )
-{
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
-   const GLubyte *color = vert1->color;
+#define NAME flat_HPCR_z_line
+#define SETUP_CODE                                             \
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);                    \
+   const GLubyte *color = vert1->color;                                \
    GLint r = color[0], g = color[1], b = color[2];
-
-#define INTERP_XY 1
 #define INTERP_Z 1
 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
 #define PIXEL_TYPE GLubyte
@@ -541,34 +482,33 @@ static void flat_HPCR_z_line( GLcontext *ctx,
           *zPtr = Z;                                           \
           *pixelPtr = (GLubyte) DITHER_HPCR( X, Y, r, g, b);   \
        }
-
 #include "swrast/s_linetemp.h"
-}
+
 
 
 static swrast_line_func get_line_func( GLcontext *ctx )
 {
-   XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
+   XMesaContext xmesa = XMESA_CONTEXT(ctx);
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
 
-   (void) DitherValues;  /* silence unused var warning */
-   (void) kernel1;  /* silence unused var warning */
-
+   if ((ctx->Color._DrawDestMask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) ==0)
+      return (swrast_line_func) NULL;
    if (ctx->RenderMode != GL_RENDER)      return (swrast_line_func) NULL;
    if (ctx->Line.SmoothFlag)              return (swrast_line_func) NULL;
-   if (ctx->Texture._ReallyEnabled)       return (swrast_line_func) NULL;
+   if (ctx->Texture._EnabledUnits)        return (swrast_line_func) NULL;
    if (ctx->Light.ShadeModel != GL_FLAT)  return (swrast_line_func) NULL;
    if (ctx->Line.StippleFlag)             return (swrast_line_func) NULL;
+   if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_line_func) NULL;
 
    if (xmesa->xm_buffer->buffer==XIMAGE
        && swrast->_RasterMask==DEPTH_BIT
        && ctx->Depth.Func==GL_LESS
        && ctx->Depth.Mask==GL_TRUE
-       && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+       && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
        && ctx->Line.Width==1.0F) {
       switch (xmesa->pixelformat) {
-         case PF_TRUECOLOR:
+         case PF_Truecolor:
             return flat_TRUECOLOR_z_line;
          case PF_8A8B8G8R:
             return flat_8A8B8G8R_z_line;
@@ -578,11 +518,11 @@ static swrast_line_func get_line_func( GLcontext *ctx )
             return flat_8R8G8B24_z_line;
          case PF_5R6G5B:
             return flat_5R6G5B_z_line;
-         case PF_DITHER_5R6G5B:
+         case PF_Dither_5R6G5B:
             return flat_DITHER_5R6G5B_z_line;
-         case PF_DITHER:
+         case PF_Dither:
             return (depth==8) ? flat_DITHER8_z_line : (swrast_line_func) NULL;
-         case PF_LOOKUP:
+         case PF_Lookup:
             return (depth==8) ? flat_LOOKUP8_z_line : (swrast_line_func) NULL;
          case PF_HPCR:
             return flat_HPCR_z_line;
@@ -594,7 +534,7 @@ static swrast_line_func get_line_func( GLcontext *ctx )
        && swrast->_RasterMask==0
        && ctx->Line.Width==1.0F) {
       switch (xmesa->pixelformat) {
-         case PF_TRUECOLOR:
+         case PF_Truecolor:
             return flat_TRUECOLOR_line;
          case PF_8A8B8G8R:
             return flat_8A8B8G8R_line;
@@ -604,11 +544,11 @@ static swrast_line_func get_line_func( GLcontext *ctx )
             return flat_8R8G8B24_line;
          case PF_5R6G5B:
             return flat_5R6G5B_line;
-         case PF_DITHER_5R6G5B:
+         case PF_Dither_5R6G5B:
             return flat_DITHER_5R6G5B_line;
-         case PF_DITHER:
+         case PF_Dither:
             return (depth==8) ? flat_DITHER8_line : (swrast_line_func) NULL;
-         case PF_LOOKUP:
+         case PF_Lookup:
             return (depth==8) ? flat_LOOKUP8_line : (swrast_line_func) NULL;
          case PF_HPCR:
             return flat_HPCR_line;
@@ -631,39 +571,3 @@ void xmesa_choose_line( GLcontext *ctx )
    if (!(swrast->Line = get_line_func( ctx )))
       _swrast_choose_line( ctx );
 }
-
-
-#define XMESA_NEW_POINT  (_NEW_POINT | \
-                          _NEW_RENDERMODE | \
-                          _SWRAST_NEW_RASTERMASK)
-
-#define XMESA_NEW_LINE   (_NEW_LINE | \
-                          _NEW_TEXTURE | \
-                          _NEW_LIGHT | \
-                          _NEW_DEPTH | \
-                          _NEW_RENDERMODE | \
-                          _SWRAST_NEW_RASTERMASK)
-
-#define XMESA_NEW_TRIANGLE (_NEW_POLYGON | \
-                            _NEW_TEXTURE | \
-                            _NEW_LIGHT | \
-                            _NEW_DEPTH | \
-                            _NEW_RENDERMODE | \
-                            _SWRAST_NEW_RASTERMASK)
-
-
-/* Extend the software rasterizer with our line/point/triangle
- * functions.
- */
-void xmesa_register_swrast_functions( GLcontext *ctx )
-{
-   SWcontext *swrast = SWRAST_CONTEXT( ctx );
-
-   swrast->choose_point = xmesa_choose_point;
-   swrast->choose_line = xmesa_choose_line;
-   swrast->choose_triangle = xmesa_choose_triangle;
-
-   swrast->invalidate_point |= XMESA_NEW_POINT;
-   swrast->invalidate_line |= XMESA_NEW_LINE;
-   swrast->invalidate_triangle |= XMESA_NEW_TRIANGLE;
-}