1 /* $Id: xm_line.c,v 1.8 2000/11/06 17:28:20 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * This file contains "accelerated" point, line, and triangle functions.
30 * It should be fairly easy to write new special-purpose point, line or
31 * triangle functions and hook them into this module.
35 #include "glxheader.h"
42 /* Internal swrast includes:
44 #include "swrast/s_depth.h"
45 #include "swrast/s_points.h"
46 #include "swrast/s_lines.h"
47 #include "swrast/s_context.h"
50 /**********************************************************************/
51 /*** Point rendering ***/
52 /**********************************************************************/
56 * Render an array of points into a pixmap, any pixel format.
58 static void draw_points_ANY_pixmap( GLcontext
*ctx
, SWvertex
*vert
)
60 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
61 XMesaDisplay
*dpy
= xmesa
->xm_visual
->display
;
62 XMesaDrawable buffer
= xmesa
->xm_buffer
->buffer
;
63 XMesaGC gc
= xmesa
->xm_buffer
->gc2
;
65 if (xmesa
->xm_visual
->gl_visual
->RGBAflag
) {
67 const GLubyte
*color
= vert
->color
;
68 unsigned long pixel
= xmesa_color_to_pixel( xmesa
,
72 XMesaSetForeground( dpy
, gc
, pixel
);
73 x
= (GLint
) vert
->win
[0];
74 y
= FLIP( xmesa
->xm_buffer
, (GLint
) vert
->win
[1] );
75 XMesaDrawPoint( dpy
, buffer
, gc
, x
, y
);
78 /* Color index mode */
80 XMesaSetForeground( dpy
, gc
, vert
->index
);
81 x
= (GLint
) vert
->win
[0];
82 y
= FLIP( xmesa
->xm_buffer
, (GLint
) vert
->win
[1] );
83 XMesaDrawPoint( dpy
, buffer
, gc
, x
, y
);
89 /* Override the swrast point-selection function. Try to use one of
90 * our internal point functions, otherwise fall back to the standard
93 void xmesa_choose_point( GLcontext
*ctx
)
95 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
96 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
98 if (ctx
->RenderMode
== GL_RENDER
99 && ctx
->Point
.Size
== 1.0F
&& !ctx
->Point
.SmoothFlag
100 && swrast
->_RasterMask
== 0
101 && !ctx
->Texture
._ReallyEnabled
102 && xmesa
->xm_buffer
->buffer
!= XIMAGE
) {
103 swrast
->Point
= draw_points_ANY_pixmap
;
106 _swrast_choose_point( ctx
);
112 /**********************************************************************/
113 /*** Line rendering ***/
114 /**********************************************************************/
119 * Render a line into a pixmap, any pixel format.
121 static void flat_pixmap_line( GLcontext
*ctx
,
122 SWvertex
*vert0
, SWvertex
*vert1
)
124 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
125 register int x0
, y0
, x1
, y1
;
128 if (xmesa
->xm_visual
->gl_visual
->RGBAflag
) {
129 const GLubyte
*color
= vert0
->color
;
130 pixel
= xmesa_color_to_pixel( xmesa
, color
[0], color
[1], color
[2], color
[3],
131 xmesa
->pixelformat
);
134 pixel
= vert0
->index
;
136 gc
= xmesa
->xm_buffer
->gc2
;
137 XMesaSetForeground( xmesa
->display
, gc
, pixel
);
139 x0
= (GLint
) vert0
->win
[0];
140 y0
= FLIP( xmesa
->xm_buffer
, (GLint
) vert0
->win
[1] );
141 x1
= (GLint
) vert1
->win
[0];
142 y1
= FLIP( xmesa
->xm_buffer
, (GLint
) vert1
->win
[1] );
143 XMesaDrawLine( xmesa
->display
, xmesa
->xm_buffer
->buffer
, gc
,
150 * Draw a flat-shaded, PF_TRUECOLOR line into an XImage.
152 static void flat_TRUECOLOR_line( GLcontext
*ctx
,
153 SWvertex
*vert0
, SWvertex
*vert1
)
155 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
156 const GLubyte
*color
= vert0
->color
;
157 XMesaImage
*img
= xmesa
->xm_buffer
->backimage
;
159 PACK_TRUECOLOR( pixel
, color
[0], color
[1], color
[2] );
163 #define PLOT(X,Y) XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel );
165 #include "swrast/s_linetemp.h"
171 * Draw a flat-shaded, PF_8A8B8G8R line into an XImage.
173 static void flat_8A8B8G8R_line( GLcontext
*ctx
,
174 SWvertex
*vert0
, SWvertex
*vert1
)
176 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
177 const GLubyte
*color
= vert0
->color
;
178 GLuint pixel
= PACK_8B8G8R( color
[0], color
[1], color
[2] );
180 #define PIXEL_TYPE GLuint
181 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
182 #define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
184 #define PLOT(X,Y) *pixelPtr = pixel;
186 #include "swrast/s_linetemp.h"
191 * Draw a flat-shaded, PF_8R8G8B line into an XImage.
193 static void flat_8R8G8B_line( GLcontext
*ctx
,
194 SWvertex
*vert0
, SWvertex
*vert1
)
196 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
197 const GLubyte
*color
= vert0
->color
;
198 GLuint pixel
= PACK_8R8G8B( color
[0], color
[1], color
[2] );
200 #define PIXEL_TYPE GLuint
201 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
202 #define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
204 #define PLOT(X,Y) *pixelPtr = pixel;
206 #include "swrast/s_linetemp.h"
211 * Draw a flat-shaded, PF_8R8G8B24 line into an XImage.
213 static void flat_8R8G8B24_line( GLcontext
*ctx
,
214 SWvertex
*vert0
, SWvertex
*vert1
)
216 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
217 const GLubyte
*color
= vert0
->color
;
219 #define PIXEL_TYPE bgr_t
220 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
221 #define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
223 #define PLOT(X,Y) { \
224 pixelPtr->r = color[RCOMP]; \
225 pixelPtr->g = color[GCOMP]; \
226 pixelPtr->b = color[BCOMP]; \
229 #include "swrast/s_linetemp.h"
234 * Draw a flat-shaded, PF_5R6G5B line into an XImage.
236 static void flat_5R6G5B_line( GLcontext
*ctx
,
237 SWvertex
*vert0
, SWvertex
*vert1
)
239 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
240 const GLubyte
*color
= vert0
->color
;
241 GLushort pixel
= PACK_5R6G5B( color
[0], color
[1], color
[2] );
243 #define PIXEL_TYPE GLushort
244 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
245 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
247 #define PLOT(X,Y) *pixelPtr = pixel;
249 #include "swrast/s_linetemp.h"
254 * Draw a flat-shaded, PF_DITHER_5R6G5B line into an XImage.
256 static void flat_DITHER_5R6G5B_line( GLcontext
*ctx
,
257 SWvertex
*vert0
, SWvertex
*vert1
)
259 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
260 const GLubyte
*color
= vert0
->color
;
262 #define PIXEL_TYPE GLushort
263 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
264 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
266 #define PLOT(X,Y) PACK_TRUEDITHER( *pixelPtr, X, Y, color[0], color[1], color[2] );
268 #include "swrast/s_linetemp.h"
274 * Draw a flat-shaded, PF_DITHER 8-bit line into an XImage.
276 static void flat_DITHER8_line( GLcontext
*ctx
,
277 SWvertex
*vert0
, SWvertex
*vert1
)
279 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
280 const GLubyte
*color
= vert0
->color
;
281 GLint r
= color
[0], g
= color
[1], b
= color
[2];
285 #define PIXEL_TYPE GLubyte
286 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
287 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
289 #define PLOT(X,Y) *pixelPtr = DITHER(X,Y,r,g,b);
291 #include "swrast/s_linetemp.h"
296 * Draw a flat-shaded, PF_LOOKUP 8-bit line into an XImage.
298 static void flat_LOOKUP8_line( GLcontext
*ctx
,
299 SWvertex
*vert0
, SWvertex
*vert1
)
301 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
302 const GLubyte
*color
= vert0
->color
;
305 pixel
= (GLubyte
) LOOKUP( color
[0], color
[1], color
[2] );
307 #define PIXEL_TYPE GLubyte
308 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
309 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
311 #define PLOT(X,Y) *pixelPtr = pixel;
313 #include "swrast/s_linetemp.h"
318 * Draw a flat-shaded, PF_HPCR line into an XImage.
320 static void flat_HPCR_line( GLcontext
*ctx
,
321 SWvertex
*vert0
, SWvertex
*vert1
)
323 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
324 const GLubyte
*color
= vert0
->color
;
325 GLint r
= color
[0], g
= color
[1], b
= color
[2];
328 #define PIXEL_TYPE GLubyte
329 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
330 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
332 #define PLOT(X,Y) *pixelPtr = (GLubyte) DITHER_HPCR(X,Y,r,g,b);
334 #include "swrast/s_linetemp.h"
340 * Draw a flat-shaded, Z-less, PF_TRUECOLOR line into an XImage.
342 static void flat_TRUECOLOR_z_line( GLcontext
*ctx
,
343 SWvertex
*vert0
, SWvertex
*vert1
)
345 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
346 const GLubyte
*color
= vert0
->color
;
347 XMesaImage
*img
= xmesa
->xm_buffer
->backimage
;
349 PACK_TRUECOLOR( pixel
, color
[0], color
[1], color
[2] );
353 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
358 XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel ); \
361 #include "swrast/s_linetemp.h"
366 * Draw a flat-shaded, Z-less, PF_8A8B8G8R line into an XImage.
368 static void flat_8A8B8G8R_z_line( GLcontext
*ctx
,
369 SWvertex
*vert0
, SWvertex
*vert1
)
371 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
372 const GLubyte
*color
= vert0
->color
;
373 GLuint pixel
= PACK_8B8G8R( color
[0], color
[1], color
[2] );
376 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
377 #define PIXEL_TYPE GLuint
378 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
379 #define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
387 #include "swrast/s_linetemp.h"
392 * Draw a flat-shaded, Z-less, PF_8R8G8B line into an XImage.
394 static void flat_8R8G8B_z_line( GLcontext
*ctx
,
395 SWvertex
*vert0
, SWvertex
*vert1
)
397 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
398 const GLubyte
*color
= vert0
->color
;
399 GLuint pixel
= PACK_8R8G8B( color
[0], color
[1], color
[2] );
402 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
403 #define PIXEL_TYPE GLuint
404 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
405 #define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
413 #include "swrast/s_linetemp.h"
418 * Draw a flat-shaded, Z-less, PF_8R8G8B24 line into an XImage.
420 static void flat_8R8G8B24_z_line( GLcontext
*ctx
,
421 SWvertex
*vert0
, SWvertex
*vert1
)
423 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
424 const GLubyte
*color
= vert0
->color
;
427 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
428 #define PIXEL_TYPE bgr_t
429 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
430 #define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
435 pixelPtr->r = color[RCOMP]; \
436 pixelPtr->g = color[GCOMP]; \
437 pixelPtr->b = color[BCOMP]; \
440 #include "swrast/s_linetemp.h"
445 * Draw a flat-shaded, Z-less, PF_5R6G5B line into an XImage.
447 static void flat_5R6G5B_z_line( GLcontext
*ctx
,
448 SWvertex
*vert0
, SWvertex
*vert1
)
450 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
451 const GLubyte
*color
= vert0
->color
;
452 GLushort pixel
= PACK_5R6G5B( color
[0], color
[1], color
[2] );
455 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
456 #define PIXEL_TYPE GLushort
457 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
458 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
465 #include "swrast/s_linetemp.h"
470 * Draw a flat-shaded, Z-less, PF_DITHER_5R6G5B line into an XImage.
472 static void flat_DITHER_5R6G5B_z_line( GLcontext
*ctx
,
473 SWvertex
*vert0
, SWvertex
*vert1
)
475 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
476 const GLubyte
*color
= vert0
->color
;
479 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
480 #define PIXEL_TYPE GLushort
481 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
482 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
487 PACK_TRUEDITHER(*pixelPtr, X, Y, color[0], color[1], color[2]); \
489 #include "swrast/s_linetemp.h"
494 * Draw a flat-shaded, Z-less, PF_DITHER 8-bit line into an XImage.
496 static void flat_DITHER8_z_line( GLcontext
*ctx
,
497 SWvertex
*vert0
, SWvertex
*vert1
)
499 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
500 const GLubyte
*color
= vert0
->color
;
501 GLint r
= color
[0], g
= color
[1], b
= color
[2];
506 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
507 #define PIXEL_TYPE GLubyte
508 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
509 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
514 *pixelPtr = (GLubyte) DITHER( X, Y, r, g, b); \
516 #include "swrast/s_linetemp.h"
521 * Draw a flat-shaded, Z-less, PF_LOOKUP 8-bit line into an XImage.
523 static void flat_LOOKUP8_z_line( GLcontext
*ctx
,
524 SWvertex
*vert0
, SWvertex
*vert1
)
526 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
527 const GLubyte
*color
= vert0
->color
;
530 pixel
= (GLubyte
) LOOKUP( color
[0], color
[1], color
[2] );
533 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
534 #define PIXEL_TYPE GLubyte
535 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
536 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
544 #include "swrast/s_linetemp.h"
549 * Draw a flat-shaded, Z-less, PF_HPCR line into an XImage.
551 static void flat_HPCR_z_line( GLcontext
*ctx
,
552 SWvertex
*vert0
, SWvertex
*vert1
)
554 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
555 const GLubyte
*color
= vert0
->color
;
556 GLint r
= color
[0], g
= color
[1], b
= color
[2];
560 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
561 #define PIXEL_TYPE GLubyte
562 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
563 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
568 *pixelPtr = (GLubyte) DITHER_HPCR( X, Y, r, g, b); \
571 #include "swrast/s_linetemp.h"
575 static swrast_line_func
get_line_func( GLcontext
*ctx
)
577 XMesaContext xmesa
= (XMesaContext
) ctx
->DriverCtx
;
578 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
579 int depth
= GET_VISUAL_DEPTH(xmesa
->xm_visual
);
581 (void) DitherValues
; /* silence unused var warning */
582 (void) kernel1
; /* silence unused var warning */
584 if (ctx
->RenderMode
!= GL_RENDER
) return (swrast_line_func
) NULL
;
585 if (ctx
->Line
.SmoothFlag
) return (swrast_line_func
) NULL
;
586 if (ctx
->Texture
._ReallyEnabled
) return (swrast_line_func
) NULL
;
587 if (ctx
->Light
.ShadeModel
!= GL_FLAT
) return (swrast_line_func
) NULL
;
588 if (ctx
->Line
.StippleFlag
) return (swrast_line_func
) NULL
;
590 if (xmesa
->xm_buffer
->buffer
==XIMAGE
591 && swrast
->_RasterMask
==DEPTH_BIT
592 && ctx
->Depth
.Func
==GL_LESS
593 && ctx
->Depth
.Mask
==GL_TRUE
594 && ctx
->Visual
.DepthBits
== DEFAULT_SOFTWARE_DEPTH_BITS
595 && ctx
->Line
.Width
==1.0F
) {
596 switch (xmesa
->pixelformat
) {
598 return flat_TRUECOLOR_z_line
;
600 return flat_8A8B8G8R_z_line
;
602 return flat_8R8G8B_z_line
;
604 return flat_8R8G8B24_z_line
;
606 return flat_5R6G5B_z_line
;
607 case PF_DITHER_5R6G5B
:
608 return flat_DITHER_5R6G5B_z_line
;
610 return (depth
==8) ? flat_DITHER8_z_line
: (swrast_line_func
) NULL
;
612 return (depth
==8) ? flat_LOOKUP8_z_line
: (swrast_line_func
) NULL
;
614 return flat_HPCR_z_line
;
616 return (swrast_line_func
)NULL
;
619 if (xmesa
->xm_buffer
->buffer
==XIMAGE
620 && swrast
->_RasterMask
==0
621 && ctx
->Line
.Width
==1.0F
) {
622 switch (xmesa
->pixelformat
) {
624 return flat_TRUECOLOR_line
;
626 return flat_8A8B8G8R_line
;
628 return flat_8R8G8B_line
;
630 return flat_8R8G8B24_line
;
632 return flat_5R6G5B_line
;
633 case PF_DITHER_5R6G5B
:
634 return flat_DITHER_5R6G5B_line
;
636 return (depth
==8) ? flat_DITHER8_line
: (swrast_line_func
) NULL
;
638 return (depth
==8) ? flat_LOOKUP8_line
: (swrast_line_func
) NULL
;
640 return flat_HPCR_line
;
642 return (swrast_line_func
)NULL
;
646 return (swrast_line_func
) NULL
;
649 /* Override for the swrast line-selection function. Try to use one
650 * of our internal line functions, otherwise fall back to the
651 * standard swrast functions.
653 void xmesa_choose_line( GLcontext
*ctx
)
655 SWcontext
*swrast
= SWRAST_CONTEXT(ctx
);
657 if (!(swrast
->Line
= get_line_func( ctx
)))
658 _swrast_choose_line( ctx
);
662 #define XMESA_NEW_POINT (_NEW_POINT | \
664 _SWRAST_NEW_RASTERMASK)
666 #define XMESA_NEW_LINE (_NEW_LINE | \
671 _SWRAST_NEW_RASTERMASK)
673 #define XMESA_NEW_TRIANGLE (_NEW_POLYGON | \
678 _SWRAST_NEW_RASTERMASK)
681 /* Extend the software rasterizer with our line/point/triangle
684 void xmesa_register_swrast_functions( GLcontext
*ctx
)
686 SWcontext
*swrast
= SWRAST_CONTEXT( ctx
);
688 swrast
->choose_point
= xmesa_choose_point
;
689 swrast
->choose_line
= xmesa_choose_line
;
690 swrast
->choose_triangle
= xmesa_choose_triangle
;
692 swrast
->invalidate_point
|= XMESA_NEW_POINT
;
693 swrast
->invalidate_line
|= XMESA_NEW_LINE
;
694 swrast
->invalidate_triangle
|= XMESA_NEW_TRIANGLE
;