From 9b507639ab31b2d611344f061614e71d47c9a84c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Oct 2006 15:21:23 +0000 Subject: [PATCH] call _swrast_span_default_color() to simplify _swrast_Bitmap(), improved comments --- src/mesa/swrast/s_bitmap.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index ab0db32..5d0e684 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5.2 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), @@ -39,8 +39,10 @@ -/* +/** * Render a bitmap. + * Called via ctx->Driver.Bitmap() + * All parameter error checking will have been done before this is called. */ void _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, @@ -82,20 +84,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY); - if (ctx->Visual.rgbMode) { - span.interpMask |= SPAN_RGBA; - span.red = FloatToFixed(ctx->Current.RasterColor[0] * CHAN_MAXF); - span.green = FloatToFixed(ctx->Current.RasterColor[1] * CHAN_MAXF); - span.blue = FloatToFixed(ctx->Current.RasterColor[2] * CHAN_MAXF); - span.alpha = FloatToFixed(ctx->Current.RasterColor[3] * CHAN_MAXF); - span.redStep = span.greenStep = span.blueStep = span.alphaStep = 0; - } - else { - span.interpMask |= SPAN_INDEX; - span.index = FloatToFixed(ctx->Current.RasterIndex); - span.indexStep = 0; - } - + _swrast_span_default_color(ctx, &span); if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); if (swrast->_FogEnabled) @@ -177,7 +166,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, #if 0 /* * XXX this is another way to implement Bitmap. Use horizontal runs of - * fragments, initializing the mask array to indicate which fragmens to + * fragments, initializing the mask array to indicate which fragments to * draw or skip. */ void -- 2.7.4