From c19d783e0715ac01ad4d3fd0705500d2bf6f7039 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 14 Nov 2000 17:40:13 +0000 Subject: Removed Driver.Color() and Driver.Index() functions. Pass color or color index directly to WriteMono*() span functions. Updated current s/w drivers accordingly. Clean-up of X gc handling in XMesa driver. --- src/mesa/drivers/windows/wmesa.c | 47 ++++++++++++---------------------------- 1 file changed, 14 insertions(+), 33 deletions(-) (limited to 'src/mesa/drivers/windows') diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c index aa0f58c5fc..55c5c402af 100644 --- a/src/mesa/drivers/windows/wmesa.c +++ b/src/mesa/drivers/windows/wmesa.c @@ -1,4 +1,4 @@ -/* $Id: wmesa.c,v 1.10 2000/11/05 18:41:00 keithw Exp $ */ +/* $Id: wmesa.c,v 1.11 2000/11/14 17:40:15 brianp Exp $ */ /* * Windows (Win32) device driver for Mesa 3.4 @@ -488,25 +488,6 @@ static GLbitfield clear(GLcontext* ctx, GLbitfield mask, -/* Set the current color index. */ -static void set_index(GLcontext* ctx, GLuint index) -{ - STARTPROFILE - Current->pixel=index; - ENDPROFILE(set_index) -} - - - -/* Set the current RGBA color. */ -static void set_color( GLcontext* ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) -{ - STARTPROFILE - Current->pixel = RGB( r, g, b ); - ENDPROFILE(set_color) -} - - static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) { if (!Current) @@ -766,7 +747,7 @@ static void write_ci8_span( const GLcontext* ctx, */ static void write_mono_ci_span(const GLcontext* ctx, GLuint n,GLint x,GLint y, - const GLubyte mask[]) + GLuint colorIndex, const GLubyte mask[]) { STARTPROFILE GLuint i; @@ -774,7 +755,7 @@ static void write_mono_ci_span(const GLcontext* ctx, assert(Current->rgb_flag==GL_FALSE); for (i=0; ipixel; + Mem[i]=colorIndex; ENDPROFILE(write_mono_ci_span) } @@ -874,8 +855,9 @@ static void write_rgb_span( const GLcontext* ctx, */ static void write_mono_rgba_span( const GLcontext* ctx, GLuint n, GLint x, GLint y, - const GLubyte mask[]) + const GLchan color[4], const GLubyte mask[]) { + ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] ); STARTPROFILE GLuint i; HDC DC=DD_GETDC; @@ -886,12 +868,12 @@ static void write_mono_rgba_span( const GLcontext* ctx, for (i=0; ipixel), GetGValue(Current->pixel), GetBValue(Current->pixel)); + wmSetPixel(pwc,y,x+i,color[RCOMP], color[GCOMP], color[BCOMP]); } else { for (i=0; ipixel); + SetPixel(DC, y, x+i, pixel); } DD_RELEASEDC; ENDPROFILE(write_mono_rgba_span) @@ -930,7 +912,7 @@ static void write_ci32_pixels( const GLcontext* ctx, static void write_mono_ci_pixels( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], - const GLubyte mask[] ) + GLuint colorIndex, const GLubyte mask[] ) { STARTPROFILE GLuint i; @@ -938,7 +920,7 @@ static void write_mono_ci_pixels( const GLcontext* ctx, for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; - *Mem = Current->pixel; + *Mem = colorIndex; } } ENDPROFILE(write_mono_ci_pixels) @@ -958,7 +940,8 @@ static void write_rgba_pixels( const GLcontext* ctx, assert(Current->rgb_flag==GL_TRUE); for (i=0; irgb_flag==GL_TRUE); for (i=0; ipixel), - GetGValue(Current->pixel), GetBValue(Current->pixel)); + wmSetPixel(pwc, FLIP(y[i]),x[i],color[RCOMP], + color[GCOMP], color[BCOMP]); DD_RELEASEDC; ENDPROFILE(write_mono_rgba_pixels) } @@ -1109,9 +1093,6 @@ void setup_DD_pointers( GLcontext* ctx ) ctx->Driver.ClearColor = clear_color; ctx->Driver.Clear = clear; - ctx->Driver.Index = set_index; - ctx->Driver.Color = set_color; - ctx->Driver.Enable = enable; ctx->Driver.SetDrawBuffer = set_draw_buffer; -- cgit v1.2.3