From: Xiang, Haihao Date: Tue, 11 Sep 2007 08:57:07 +0000 (+0800) Subject: i965: take the secondary color into account when drawing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0aedb9a2042bef9c13358500f93acaf8459a74cb;p=mesa.git i965: take the secondary color into account when drawing bitmap. fix#10688 --- diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c index 23f381fe917..79c1fee9c07 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c @@ -168,7 +168,8 @@ do_blit_bitmap( GLcontext *ctx, { struct intel_context *intel = intel_context(ctx); struct intel_region *dst = intel_drawbuf_region(intel); - + GLfloat tmpColor[4]; + union { GLuint ui; GLubyte ub[4]; @@ -183,10 +184,16 @@ do_blit_bitmap( GLcontext *ctx, return GL_TRUE; /* even though this is an error, we're done */ } - UNCLAMPED_FLOAT_TO_CHAN(color.ub[0], ctx->Current.RasterColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(color.ub[1], ctx->Current.RasterColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(color.ub[2], ctx->Current.RasterColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(color.ub[3], ctx->Current.RasterColor[3]); + COPY_4V(tmpColor, ctx->Current.RasterColor); + + if (NEED_SECONDARY_COLOR(ctx)) { + ADD_3V(tmpColor, tmpColor, ctx->Current.RasterSecondaryColor); + } + + UNCLAMPED_FLOAT_TO_CHAN(color.ub[0], tmpColor[2]); + UNCLAMPED_FLOAT_TO_CHAN(color.ub[1], tmpColor[1]); + UNCLAMPED_FLOAT_TO_CHAN(color.ub[2], tmpColor[0]); + UNCLAMPED_FLOAT_TO_CHAN(color.ub[3], tmpColor[3]); /* Does zoom apply to bitmaps? */