Set 'prefer_float_colors' true, now that tnl uses them natively.
Apply Jeff Epler's optimization to ci spans as well, remove old code.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: xm_span.c,v 1.12 2001/05/10 14:21:17 brianp Exp $ */
|
/* $Id: xm_span.c,v 1.13 2001/05/10 15:42:43 keithw Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -2547,51 +2547,35 @@ static void write_span_mono_pixmap( MONO_SPAN_ARGS )
|
|||||||
XMesaGC gc = xmesa->xm_buffer->gc;
|
XMesaGC gc = xmesa->xm_buffer->gc;
|
||||||
const unsigned long pixel = xmesa_color_to_pixel(xmesa, color[RCOMP],
|
const unsigned long pixel = xmesa_color_to_pixel(xmesa, color[RCOMP],
|
||||||
color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat);
|
color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat);
|
||||||
register GLboolean write_all;
|
|
||||||
register GLuint i;
|
register GLuint i;
|
||||||
XMesaSetForeground( xmesa->display, gc, pixel );
|
XMesaSetForeground( xmesa->display, gc, pixel );
|
||||||
y = FLIP(xmesa->xm_buffer, y);
|
y = FLIP(xmesa->xm_buffer, y);
|
||||||
write_all = GL_TRUE;
|
|
||||||
for (i=0;i<n;i++) {
|
/* New code contributed by Jeff Epler and cleaned up by Keith
|
||||||
if (!mask[i]) {
|
* Whitwell.
|
||||||
write_all = GL_FALSE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (write_all) {
|
|
||||||
XMesaFillRectangle( dpy, buffer, gc, (int) x, (int) y, n, 1 );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
#if 0
|
|
||||||
for (i=0;i<n;i++,x++) {
|
|
||||||
if (mask[i]) {
|
|
||||||
XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/* This version is usually faster. Contributed by Jeff Epler
|
|
||||||
* and cleaned up by Keith Whitwell.
|
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < n; ) {
|
for (i = 0; i < n; ) {
|
||||||
GLuint start = i;
|
GLuint start = i;
|
||||||
|
|
||||||
/* Identify and emit contiguous rendered pixels
|
/* Identify and emit contiguous rendered pixels
|
||||||
*/
|
*/
|
||||||
for( ; i < n && mask[i]; i++)
|
while (i < n && mask[i])
|
||||||
/* Nothing */;
|
i++;
|
||||||
|
|
||||||
if (start < i)
|
if (start < i)
|
||||||
XMesaFillRectangle( dpy, buffer, gc,
|
XMesaFillRectangle( dpy, buffer, gc,
|
||||||
(int)(x+start), (int) y,
|
(int)(x+start), (int) y,
|
||||||
(int)(i-start), 1);
|
(int)(i-start), 1);
|
||||||
|
|
||||||
/* Eat up non-rendered pixels
|
/* Eat up non-rendered pixels
|
||||||
*/
|
*/
|
||||||
for(; i < n && !mask[i]; i++)
|
while (i < n && !mask[i])
|
||||||
/* Nothing */;
|
i++;
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void write_span_mono_index_pixmap( const GLcontext *ctx, GLuint n,
|
static void write_span_mono_index_pixmap( const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y, GLuint colorIndex,
|
GLint x, GLint y, GLuint colorIndex,
|
||||||
const GLubyte mask[] )
|
const GLubyte mask[] )
|
||||||
@@ -2600,26 +2584,27 @@ static void write_span_mono_index_pixmap( const GLcontext *ctx, GLuint n,
|
|||||||
XMesaDisplay *dpy = xmesa->xm_visual->display;
|
XMesaDisplay *dpy = xmesa->xm_visual->display;
|
||||||
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
|
XMesaDrawable buffer = xmesa->xm_buffer->buffer;
|
||||||
XMesaGC gc = xmesa->xm_buffer->gc;
|
XMesaGC gc = xmesa->xm_buffer->gc;
|
||||||
register GLboolean write_all;
|
|
||||||
register GLuint i;
|
register GLuint i;
|
||||||
XMesaSetForeground( xmesa->display, gc, colorIndex );
|
XMesaSetForeground( xmesa->display, gc, colorIndex );
|
||||||
y = FLIP(xmesa->xm_buffer, y);
|
y = FLIP(xmesa->xm_buffer, y);
|
||||||
write_all = GL_TRUE;
|
|
||||||
for (i=0;i<n;i++) {
|
for (i = 0 ; i < n ;) {
|
||||||
if (!mask[i]) {
|
GLuint start = i;
|
||||||
write_all = GL_FALSE;
|
|
||||||
break;
|
/* Identify and emit contiguous rendered pixels
|
||||||
}
|
*/
|
||||||
}
|
while (i < n && mask[i])
|
||||||
if (write_all) {
|
i++;
|
||||||
XMesaFillRectangle( dpy, buffer, gc, (int) x, (int) y, n, 1 );
|
|
||||||
}
|
if (start < i)
|
||||||
else {
|
XMesaFillRectangle( dpy, buffer, gc,
|
||||||
for (i=0;i<n;i++,x++) {
|
(int)(x+start), (int) y,
|
||||||
if (mask[i]) {
|
(int)(i-start), 1);
|
||||||
XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y );
|
|
||||||
}
|
/* Eat up non-rendered pixels
|
||||||
}
|
*/
|
||||||
|
while (i < n && !mask[i])
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: api_loopback.c,v 1.7 2001/03/12 00:48:37 gareth Exp $ */
|
/* $Id: api_loopback.c,v 1.8 2001/05/10 15:42:42 keithw Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -1444,7 +1444,7 @@ _mesa_loopback_prefer_float( struct _glapi_table *dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Passing prefer_f_colors as true will mean that all colors
|
/* Passing prefer_float_colors as true will mean that all colors
|
||||||
* *except* Color{34}ub{v} are passed as floats. Setting it false will
|
* *except* Color{34}ub{v} are passed as floats. Setting it false will
|
||||||
* mean all colors *except* Color{34}f{v} are passed as ubytes.
|
* mean all colors *except* Color{34}f{v} are passed as ubytes.
|
||||||
*
|
*
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: dlist.c,v 1.69 2001/05/09 12:48:21 keithw Exp $ */
|
/* $Id: dlist.c,v 1.70 2001/05/10 15:42:42 keithw Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -5533,7 +5533,7 @@ _mesa_init_dlist_table( struct _glapi_table *table, GLuint tableSize )
|
|||||||
{
|
{
|
||||||
_mesa_init_no_op_table(table, tableSize);
|
_mesa_init_no_op_table(table, tableSize);
|
||||||
|
|
||||||
_mesa_loopback_init_api_table( table, GL_FALSE );
|
_mesa_loopback_init_api_table( table, GL_TRUE );
|
||||||
|
|
||||||
/* GL 1.0 */
|
/* GL 1.0 */
|
||||||
table->Accum = save_Accum;
|
table->Accum = save_Accum;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: state.c,v 1.64 2001/03/29 21:16:25 keithw Exp $ */
|
/* $Id: state.c,v 1.65 2001/05/10 15:42:43 keithw Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -123,7 +123,7 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
|
|||||||
/* first initialize all dispatch slots to no-op */
|
/* first initialize all dispatch slots to no-op */
|
||||||
_mesa_init_no_op_table(exec, tableSize);
|
_mesa_init_no_op_table(exec, tableSize);
|
||||||
|
|
||||||
_mesa_loopback_init_api_table( exec, GL_FALSE );
|
_mesa_loopback_init_api_table( exec, GL_TRUE );
|
||||||
|
|
||||||
/* load the dispatch slots we understand */
|
/* load the dispatch slots we understand */
|
||||||
exec->Accum = _mesa_Accum;
|
exec->Accum = _mesa_Accum;
|
||||||
|
Reference in New Issue
Block a user