Removed all RCS / CVS tags (Id, Header, Date, etc.) from everything.
[mesa.git] / src / mesa / drivers / x11 / xm_line.c
1
2 /*
3 * Mesa 3-D graphics library
4 * Version: 5.1
5 *
6 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26
27 /*
28 * This file contains "accelerated" point, line, and triangle functions.
29 * It should be fairly easy to write new special-purpose point, line or
30 * triangle functions and hook them into this module.
31 */
32
33
34 #include "glxheader.h"
35 #include "depth.h"
36 #include "macros.h"
37 #include "mtypes.h"
38 #include "xmesaP.h"
39
40 /* Internal swrast includes:
41 */
42 #include "swrast/s_depth.h"
43 #include "swrast/s_points.h"
44 #include "swrast/s_lines.h"
45 #include "swrast/s_context.h"
46
47
48 /**********************************************************************/
49 /*** Point rendering ***/
50 /**********************************************************************/
51
52
53 /*
54 * Render an array of points into a pixmap, any pixel format.
55 */
56 #if 000
57 /* XXX don't use this, it doesn't dither correctly */
58 static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert )
59 {
60 XMesaContext xmesa = XMESA_CONTEXT(ctx);
61 XMesaDisplay *dpy = xmesa->xm_visual->display;
62 XMesaDrawable buffer = xmesa->xm_buffer->buffer;
63 XMesaGC gc = xmesa->xm_buffer->gc;
64
65 if (xmesa->xm_visual->mesa_visual.RGBAflag) {
66 register int x, y;
67 const GLubyte *color = vert->color;
68 unsigned long pixel = xmesa_color_to_pixel( xmesa,
69 color[0], color[1],
70 color[2], color[3],
71 xmesa->pixelformat);
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);
76 }
77 else {
78 /* Color index mode */
79 register int x, y;
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);
84 }
85 }
86 #endif
87
88
89 /* Override the swrast point-selection function. Try to use one of
90 * our internal point functions, otherwise fall back to the standard
91 * swrast functions.
92 */
93 void xmesa_choose_point( GLcontext *ctx )
94 {
95 #if 0
96 XMesaContext xmesa = XMESA_CONTEXT(ctx);
97 SWcontext *swrast = SWRAST_CONTEXT(ctx);
98
99 if (ctx->RenderMode == GL_RENDER
100 && ctx->Point.Size == 1.0F && !ctx->Point.SmoothFlag
101 && swrast->_RasterMask == 0
102 && !ctx->Texture._EnabledUnits
103 && xmesa->xm_buffer->buffer != XIMAGE) {
104 swrast->Point = draw_points_ANY_pixmap;
105 }
106 else {
107 _swrast_choose_point( ctx );
108 }
109 #else
110 _swrast_choose_point( ctx );
111 #endif
112 }
113
114
115
116 /**********************************************************************/
117 /*** Line rendering ***/
118 /**********************************************************************/
119
120
121 /*
122 * Draw a flat-shaded, PF_TRUECOLOR line into an XImage.
123 */
124 #define NAME flat_TRUECOLOR_line
125 #define SETUP_CODE \
126 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
127 const GLubyte *color = vert1->color; \
128 XMesaImage *img = xmesa->xm_buffer->backimage; \
129 unsigned long pixel; \
130 PACK_TRUECOLOR( pixel, color[0], color[1], color[2] );
131 #define CLIP_HACK 1
132 #define PLOT(X,Y) XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel );
133 #include "swrast/s_linetemp.h"
134
135
136
137 /*
138 * Draw a flat-shaded, PF_8A8B8G8R line into an XImage.
139 */
140 #define NAME flat_8A8B8G8R_line
141 #define SETUP_CODE \
142 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
143 const GLubyte *color = vert1->color; \
144 GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] );
145 #define PIXEL_TYPE GLuint
146 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
147 #define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
148 #define CLIP_HACK 1
149 #define PLOT(X,Y) *pixelPtr = pixel;
150 #include "swrast/s_linetemp.h"
151
152
153
154 /*
155 * Draw a flat-shaded, PF_8R8G8B line into an XImage.
156 */
157 #define NAME flat_8R8G8B_line
158 #define SETUP_CODE \
159 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
160 const GLubyte *color = vert1->color; \
161 GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] );
162 #define PIXEL_TYPE GLuint
163 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
164 #define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
165 #define CLIP_HACK 1
166 #define PLOT(X,Y) *pixelPtr = pixel;
167 #include "swrast/s_linetemp.h"
168
169
170
171 /*
172 * Draw a flat-shaded, PF_8R8G8B24 line into an XImage.
173 */
174 #define NAME flat_8R8G8B24_line
175 #define SETUP_CODE \
176 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
177 const GLubyte *color = vert1->color;
178 #define PIXEL_TYPE bgr_t
179 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
180 #define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
181 #define CLIP_HACK 1
182 #define PLOT(X,Y) { \
183 pixelPtr->r = color[RCOMP]; \
184 pixelPtr->g = color[GCOMP]; \
185 pixelPtr->b = color[BCOMP]; \
186 }
187 #include "swrast/s_linetemp.h"
188
189
190
191 /*
192 * Draw a flat-shaded, PF_5R6G5B line into an XImage.
193 */
194 #define NAME flat_5R6G5B_line
195 #define SETUP_CODE \
196 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
197 const GLubyte *color = vert1->color; \
198 GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] );
199 #define PIXEL_TYPE GLushort
200 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
201 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
202 #define CLIP_HACK 1
203 #define PLOT(X,Y) *pixelPtr = pixel;
204 #include "swrast/s_linetemp.h"
205
206
207
208 /*
209 * Draw a flat-shaded, PF_DITHER_5R6G5B line into an XImage.
210 */
211 #define NAME flat_DITHER_5R6G5B_line
212 #define SETUP_CODE \
213 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
214 const GLubyte *color = vert1->color;
215 #define PIXEL_TYPE GLushort
216 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
217 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
218 #define CLIP_HACK 1
219 #define PLOT(X,Y) PACK_TRUEDITHER( *pixelPtr, X, Y, color[0], color[1], color[2] );
220 #include "swrast/s_linetemp.h"
221
222
223
224
225 /*
226 * Draw a flat-shaded, PF_DITHER 8-bit line into an XImage.
227 */
228 #define NAME flat_DITHER8_line
229 #define SETUP_CODE \
230 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
231 const GLubyte *color = vert1->color; \
232 GLint r = color[0], g = color[1], b = color[2]; \
233 DITHER_SETUP;
234 #define PIXEL_TYPE GLubyte
235 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
236 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
237 #define CLIP_HACK 1
238 #define PLOT(X,Y) *pixelPtr = DITHER(X,Y,r,g,b);
239 #include "swrast/s_linetemp.h"
240
241
242
243 /*
244 * Draw a flat-shaded, PF_LOOKUP 8-bit line into an XImage.
245 */
246 #define NAME flat_LOOKUP8_line
247 #define SETUP_CODE \
248 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
249 const GLubyte *color = vert1->color; \
250 GLubyte pixel; \
251 LOOKUP_SETUP; \
252 pixel = (GLubyte) LOOKUP( color[0], color[1], color[2] );
253 #define PIXEL_TYPE GLubyte
254 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
255 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
256 #define CLIP_HACK 1
257 #define PLOT(X,Y) *pixelPtr = pixel;
258 #include "swrast/s_linetemp.h"
259
260
261
262 /*
263 * Draw a flat-shaded, PF_HPCR line into an XImage.
264 */
265 #define NAME flat_HPCR_line
266 #define SETUP_CODE \
267 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
268 const GLubyte *color = vert1->color; \
269 GLint r = color[0], g = color[1], b = color[2];
270 #define PIXEL_TYPE GLubyte
271 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
272 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
273 #define CLIP_HACK 1
274 #define PLOT(X,Y) *pixelPtr = (GLubyte) DITHER_HPCR(X,Y,r,g,b);
275 #include "swrast/s_linetemp.h"
276
277
278
279
280 /*
281 * Draw a flat-shaded, Z-less, PF_TRUECOLOR line into an XImage.
282 */
283 #define NAME flat_TRUECOLOR_z_line
284 #define SETUP_CODE \
285 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
286 const GLubyte *color = vert1->color; \
287 XMesaImage *img = xmesa->xm_buffer->backimage; \
288 unsigned long pixel; \
289 PACK_TRUECOLOR( pixel, color[0], color[1], color[2] );
290 #define INTERP_Z 1
291 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
292 #define CLIP_HACK 1
293 #define PLOT(X,Y) \
294 if (Z < *zPtr) { \
295 *zPtr = Z; \
296 XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel ); \
297 }
298 #include "swrast/s_linetemp.h"
299
300
301
302 /*
303 * Draw a flat-shaded, Z-less, PF_8A8B8G8R line into an XImage.
304 */
305 #define NAME flat_8A8B8G8R_z_line
306 #define SETUP_CODE \
307 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
308 const GLubyte *color = vert1->color; \
309 GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] );
310 #define INTERP_Z 1
311 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
312 #define PIXEL_TYPE GLuint
313 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
314 #define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
315 #define CLIP_HACK 1
316 #define PLOT(X,Y) \
317 if (Z < *zPtr) { \
318 *zPtr = Z; \
319 *pixelPtr = pixel; \
320 }
321 #include "swrast/s_linetemp.h"
322
323
324
325 /*
326 * Draw a flat-shaded, Z-less, PF_8R8G8B line into an XImage.
327 */
328 #define NAME flat_8R8G8B_z_line
329 #define SETUP_CODE \
330 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
331 const GLubyte *color = vert1->color; \
332 GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] );
333 #define INTERP_Z 1
334 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
335 #define PIXEL_TYPE GLuint
336 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
337 #define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y)
338 #define CLIP_HACK 1
339 #define PLOT(X,Y) \
340 if (Z < *zPtr) { \
341 *zPtr = Z; \
342 *pixelPtr = pixel; \
343 }
344 #include "swrast/s_linetemp.h"
345
346
347
348 /*
349 * Draw a flat-shaded, Z-less, PF_8R8G8B24 line into an XImage.
350 */
351 #define NAME flat_8R8G8B24_z_line
352 #define SETUP_CODE \
353 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
354 const GLubyte *color = vert1->color;
355 #define INTERP_Z 1
356 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
357 #define PIXEL_TYPE bgr_t
358 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
359 #define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
360 #define CLIP_HACK 1
361 #define PLOT(X,Y) \
362 if (Z < *zPtr) { \
363 *zPtr = Z; \
364 pixelPtr->r = color[RCOMP]; \
365 pixelPtr->g = color[GCOMP]; \
366 pixelPtr->b = color[BCOMP]; \
367 }
368 #include "swrast/s_linetemp.h"
369
370
371
372 /*
373 * Draw a flat-shaded, Z-less, PF_5R6G5B line into an XImage.
374 */
375 #define NAME flat_5R6G5B_z_line
376 #define SETUP_CODE \
377 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
378 const GLubyte *color = vert1->color; \
379 GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] );
380 #define INTERP_Z 1
381 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
382 #define PIXEL_TYPE GLushort
383 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
384 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
385 #define CLIP_HACK 1
386 #define PLOT(X,Y) \
387 if (Z < *zPtr) { \
388 *zPtr = Z; \
389 *pixelPtr = pixel; \
390 }
391 #include "swrast/s_linetemp.h"
392
393
394
395 /*
396 * Draw a flat-shaded, Z-less, PF_DITHER_5R6G5B line into an XImage.
397 */
398 #define NAME flat_DITHER_5R6G5B_z_line
399 #define SETUP_CODE \
400 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
401 const GLubyte *color = vert1->color;
402 #define INTERP_Z 1
403 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
404 #define PIXEL_TYPE GLushort
405 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
406 #define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
407 #define CLIP_HACK 1
408 #define PLOT(X,Y) \
409 if (Z < *zPtr) { \
410 *zPtr = Z; \
411 PACK_TRUEDITHER(*pixelPtr, X, Y, color[0], color[1], color[2]); \
412 }
413 #include "swrast/s_linetemp.h"
414
415
416
417 /*
418 * Draw a flat-shaded, Z-less, PF_DITHER 8-bit line into an XImage.
419 */
420 #define NAME flat_DITHER8_z_line
421 #define SETUP_CODE \
422 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
423 const GLubyte *color = vert1->color; \
424 GLint r = color[0], g = color[1], b = color[2]; \
425 DITHER_SETUP;
426 #define INTERP_Z 1
427 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
428 #define PIXEL_TYPE GLubyte
429 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
430 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
431 #define CLIP_HACK 1
432 #define PLOT(X,Y) \
433 if (Z < *zPtr) { \
434 *zPtr = Z; \
435 *pixelPtr = (GLubyte) DITHER( X, Y, r, g, b); \
436 }
437 #include "swrast/s_linetemp.h"
438
439
440
441 /*
442 * Draw a flat-shaded, Z-less, PF_LOOKUP 8-bit line into an XImage.
443 */
444 #define NAME flat_LOOKUP8_z_line
445 #define SETUP_CODE \
446 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
447 const GLubyte *color = vert1->color; \
448 GLubyte pixel; \
449 LOOKUP_SETUP; \
450 pixel = (GLubyte) LOOKUP( color[0], color[1], color[2] );
451 #define INTERP_Z 1
452 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
453 #define PIXEL_TYPE GLubyte
454 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
455 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
456 #define CLIP_HACK 1
457 #define PLOT(X,Y) \
458 if (Z < *zPtr) { \
459 *zPtr = Z; \
460 *pixelPtr = pixel; \
461 }
462 #include "swrast/s_linetemp.h"
463
464
465
466 /*
467 * Draw a flat-shaded, Z-less, PF_HPCR line into an XImage.
468 */
469 #define NAME flat_HPCR_z_line
470 #define SETUP_CODE \
471 XMesaContext xmesa = XMESA_CONTEXT(ctx); \
472 const GLubyte *color = vert1->color; \
473 GLint r = color[0], g = color[1], b = color[2];
474 #define INTERP_Z 1
475 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
476 #define PIXEL_TYPE GLubyte
477 #define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
478 #define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y)
479 #define CLIP_HACK 1
480 #define PLOT(X,Y) \
481 if (Z < *zPtr) { \
482 *zPtr = Z; \
483 *pixelPtr = (GLubyte) DITHER_HPCR( X, Y, r, g, b); \
484 }
485 #include "swrast/s_linetemp.h"
486
487
488
489 static swrast_line_func get_line_func( GLcontext *ctx )
490 {
491 XMesaContext xmesa = XMESA_CONTEXT(ctx);
492 SWcontext *swrast = SWRAST_CONTEXT(ctx);
493 int depth = GET_VISUAL_DEPTH(xmesa->xm_visual);
494
495 (void) DitherValues; /* silence unused var warning */
496 (void) kernel1; /* silence unused var warning */
497
498 if (ctx->RenderMode != GL_RENDER) return (swrast_line_func) NULL;
499 if (ctx->Line.SmoothFlag) return (swrast_line_func) NULL;
500 if (ctx->Texture._EnabledUnits) return (swrast_line_func) NULL;
501 if (ctx->Light.ShadeModel != GL_FLAT) return (swrast_line_func) NULL;
502 if (ctx->Line.StippleFlag) return (swrast_line_func) NULL;
503 if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_line_func) NULL;
504
505 if (xmesa->xm_buffer->buffer==XIMAGE
506 && swrast->_RasterMask==DEPTH_BIT
507 && ctx->Depth.Func==GL_LESS
508 && ctx->Depth.Mask==GL_TRUE
509 && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
510 && ctx->Line.Width==1.0F) {
511 switch (xmesa->pixelformat) {
512 case PF_Truecolor:
513 return flat_TRUECOLOR_z_line;
514 case PF_8A8B8G8R:
515 return flat_8A8B8G8R_z_line;
516 case PF_8R8G8B:
517 return flat_8R8G8B_z_line;
518 case PF_8R8G8B24:
519 return flat_8R8G8B24_z_line;
520 case PF_5R6G5B:
521 return flat_5R6G5B_z_line;
522 case PF_Dither_5R6G5B:
523 return flat_DITHER_5R6G5B_z_line;
524 case PF_Dither:
525 return (depth==8) ? flat_DITHER8_z_line : (swrast_line_func) NULL;
526 case PF_Lookup:
527 return (depth==8) ? flat_LOOKUP8_z_line : (swrast_line_func) NULL;
528 case PF_HPCR:
529 return flat_HPCR_z_line;
530 default:
531 return (swrast_line_func)NULL;
532 }
533 }
534 if (xmesa->xm_buffer->buffer==XIMAGE
535 && swrast->_RasterMask==0
536 && ctx->Line.Width==1.0F) {
537 switch (xmesa->pixelformat) {
538 case PF_Truecolor:
539 return flat_TRUECOLOR_line;
540 case PF_8A8B8G8R:
541 return flat_8A8B8G8R_line;
542 case PF_8R8G8B:
543 return flat_8R8G8B_line;
544 case PF_8R8G8B24:
545 return flat_8R8G8B24_line;
546 case PF_5R6G5B:
547 return flat_5R6G5B_line;
548 case PF_Dither_5R6G5B:
549 return flat_DITHER_5R6G5B_line;
550 case PF_Dither:
551 return (depth==8) ? flat_DITHER8_line : (swrast_line_func) NULL;
552 case PF_Lookup:
553 return (depth==8) ? flat_LOOKUP8_line : (swrast_line_func) NULL;
554 case PF_HPCR:
555 return flat_HPCR_line;
556 default:
557 return (swrast_line_func)NULL;
558 }
559 }
560
561 return (swrast_line_func) NULL;
562 }
563
564 /* Override for the swrast line-selection function. Try to use one
565 * of our internal line functions, otherwise fall back to the
566 * standard swrast functions.
567 */
568 void xmesa_choose_line( GLcontext *ctx )
569 {
570 SWcontext *swrast = SWRAST_CONTEXT(ctx);
571
572 if (!(swrast->Line = get_line_func( ctx )))
573 _swrast_choose_line( ctx );
574 }