From: Brian Paul Date: Fri, 10 Mar 2000 22:12:22 +0000 (+0000) Subject: glPopAttrib() now calls Driver's ClearColor, ClearIndex and ColorMask functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=516b8363bbe8e625e8e773630772da950eff7d2a;p=mesa.git glPopAttrib() now calls Driver's ClearColor, ClearIndex and ColorMask functions --- diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 4ad733b3cdf..95d2bc4ebfc 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,4 +1,4 @@ -/* $Id: attrib.c,v 1.18 2000/03/03 18:55:45 brianp Exp $ */ +/* $Id: attrib.c,v 1.19 2000/03/10 22:12:22 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -429,19 +429,37 @@ _mesa_PopAttrib(void) if (ctx->Color.DrawBuffer != oldDrawBuffer) { _mesa_DrawBuffer( ctx->Color.DrawBuffer); } - if ((ctx->Color.AlphaFunc != oldAlphaFunc || - ctx->Color.AlphaRef != oldAlphaRef) && - ctx->Driver.AlphaFunc) - (*ctx->Driver.AlphaFunc)( ctx, ctx->Color.AlphaFunc, - ctx->Color.AlphaRef / 255.0F); if ((ctx->Color.BlendSrcRGB != oldBlendSrc || - ctx->Color.BlendSrcRGB != oldBlendDst) && + ctx->Color.BlendDstRGB != oldBlendDst) && ctx->Driver.BlendFunc) (*ctx->Driver.BlendFunc)( ctx, ctx->Color.BlendSrcRGB, ctx->Color.BlendDstRGB); if (ctx->Color.LogicOp != oldLogicOp && - ctx->Driver.LogicOpcode) + ctx->Driver.LogicOpcode) { ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp ); + } + if (ctx->Visual->RGBAflag) { + GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F); + GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F); + GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F); + GLubyte a = (GLint) (ctx->Color.ClearColor[3] * 255.0F); + (*ctx->Driver.ClearColor)( ctx, r, g, b, a ); + if ((ctx->Color.AlphaFunc != oldAlphaFunc || + ctx->Color.AlphaRef != oldAlphaRef) && + ctx->Driver.AlphaFunc) + (*ctx->Driver.AlphaFunc)( ctx, ctx->Color.AlphaFunc, + ctx->Color.AlphaRef / 255.0F); + if (ctx->Driver.ColorMask) { + (*ctx->Driver.ColorMask)(ctx, + ctx->Color.ColorMask[0], + ctx->Color.ColorMask[1], + ctx->Color.ColorMask[2], + ctx->Color.ColorMask[3]); + } + } + else { + (*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex); + } } break; case GL_CURRENT_BIT: