Removed all RCS / CVS tags (Id, Header, Date, etc.) from everything.
[mesa.git] / src / mesa / swrast / s_alphabuf.c
index b5a2e3151320746896c54f31414f0f4c52bd5be7..c74ab45a44c5f896d5632e421799a546911b2957 100644 (file)
@@ -1,8 +1,7 @@
-/* $Id: s_alphabuf.c,v 1.15 2002/10/24 23:57:24 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
+ * Version:  5.0.1
  *
  * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
  *
@@ -32,6 +31,7 @@
 
 
 #include "glheader.h"
+#include "colormac.h"
 #include "context.h"
 #include "imports.h"
 
@@ -43,7 +43,7 @@
  * Allocate a new front and back alpha buffer.
  */
 void
-_mesa_alloc_alpha_buffers( GLframebuffer *buffer )
+_swrast_alloc_alpha_buffers( GLframebuffer *buffer )
 {
    const GLint bytes = buffer->Width * buffer->Height * sizeof(GLchan);
 
@@ -101,11 +101,13 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer )
  * Clear all the alpha buffers
  */
 void
-_mesa_clear_alpha_buffers( GLcontext *ctx )
+_swrast_clear_alpha_buffers( GLcontext *ctx )
 {
-   const GLchan aclear = (GLchan) ctx->Color.ClearColor[3];
+   GLchan aclear;
    GLuint bufferBit;
 
+   CLAMPED_FLOAT_TO_CHAN(aclear, ctx->Color.ClearColor[3]);
+
    ASSERT(ctx->DrawBuffer->UseSoftwareAlphaBuffers);
    ASSERT(ctx->Color.ColorMask[ACOMP]);
 
@@ -195,7 +197,7 @@ GLchan *get_alpha_buffer( GLcontext *ctx )
 
 
 void
-_mesa_write_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
+_swrast_write_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
                         CONST GLchan rgba[][4], const GLubyte mask[] )
 {
    GLchan *buffer, *aptr;
@@ -221,7 +223,7 @@ _mesa_write_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
 
 
 void
-_mesa_write_mono_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
+_swrast_write_mono_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
                              GLchan alpha, const GLubyte mask[] )
 {
    GLchan *buffer, *aptr;
@@ -247,7 +249,7 @@ _mesa_write_mono_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
 
 
 void
-_mesa_write_alpha_pixels( GLcontext *ctx,
+_swrast_write_alpha_pixels( GLcontext *ctx,
                           GLuint n, const GLint x[], const GLint y[],
                           CONST GLchan rgba[][4], const GLubyte mask[] )
 {
@@ -274,7 +276,7 @@ _mesa_write_alpha_pixels( GLcontext *ctx,
 
 
 void
-_mesa_write_mono_alpha_pixels( GLcontext *ctx,
+_swrast_write_mono_alpha_pixels( GLcontext *ctx,
                                GLuint n, const GLint x[], const GLint y[],
                                GLchan alpha, const GLubyte mask[] )
 {
@@ -302,7 +304,7 @@ _mesa_write_mono_alpha_pixels( GLcontext *ctx,
 
 
 void
-_mesa_read_alpha_span( GLcontext *ctx,
+_swrast_read_alpha_span( GLcontext *ctx,
                        GLuint n, GLint x, GLint y, GLchan rgba[][4] )
 {
    const GLchan *buffer, *aptr;
@@ -317,7 +319,7 @@ _mesa_read_alpha_span( GLcontext *ctx,
 
 
 void
-_mesa_read_alpha_pixels( GLcontext *ctx,
+_swrast_read_alpha_pixels( GLcontext *ctx,
                          GLuint n, const GLint x[], const GLint y[],
                          GLchan rgba[][4], const GLubyte mask[] )
 {