projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added SPAN_W
[mesa.git]
/
src
/
mesa
/
swrast
/
s_alphabuf.c
diff --git
a/src/mesa/swrast/s_alphabuf.c
b/src/mesa/swrast/s_alphabuf.c
index b303c0fc76c061b4a5601c8510310de5e7ec080e..e0468a4c91f872907bc718672cbabf9ee198a44c 100644
(file)
--- a/
src/mesa/swrast/s_alphabuf.c
+++ b/
src/mesa/swrast/s_alphabuf.c
@@
-1,10
+1,8
@@
-/* $Id: s_alphabuf.c,v 1.11 2002/07/09 01:22:52 brianp Exp $ */
-
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
- * Version:
4.0.2
+ * Version:
6.1
*
*
- * Copyright (C) 1999-200
2
Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-200
4
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"),
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@
-32,9
+30,11
@@
#include "glheader.h"
#include "glheader.h"
+#include "colormac.h"
#include "context.h"
#include "context.h"
-#include "
mem
.h"
+#include "
imports
.h"
+#include "s_context.h"
#include "s_alphabuf.h"
#include "s_alphabuf.h"
@@
-42,7
+42,7
@@
* Allocate a new front and back alpha buffer.
*/
void
* 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);
{
const GLint bytes = buffer->Width * buffer->Height * sizeof(GLchan);
@@
-100,11
+100,13
@@
_mesa_alloc_alpha_buffers( GLframebuffer *buffer )
* Clear all the alpha buffers
*/
void
* Clear all the alpha buffers
*/
void
-_
mesa
_clear_alpha_buffers( GLcontext *ctx )
+_
swrast
_clear_alpha_buffers( GLcontext *ctx )
{
{
-
const GLchan aclear = ctx->Color.ClearColor[3]
;
+
GLchan aclear
;
GLuint bufferBit;
GLuint bufferBit;
+ CLAMPED_FLOAT_TO_CHAN(aclear, ctx->Color.ClearColor[3]);
+
ASSERT(ctx->DrawBuffer->UseSoftwareAlphaBuffers);
ASSERT(ctx->Color.ColorMask[ACOMP]);
ASSERT(ctx->DrawBuffer->UseSoftwareAlphaBuffers);
ASSERT(ctx->Color.ColorMask[ACOMP]);
@@
-171,28
+173,30
@@
_mesa_clear_alpha_buffers( GLcontext *ctx )
static INLINE
GLchan *get_alpha_buffer( GLcontext *ctx )
{
static INLINE
GLchan *get_alpha_buffer( GLcontext *ctx )
{
- switch (ctx->Color._DriverDrawBuffer) {
- case GL_FRONT_LEFT:
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+
+ switch (swrast->CurrentBuffer) {
+ case FRONT_LEFT_BIT:
return ctx->DrawBuffer->FrontLeftAlpha;
break;
return ctx->DrawBuffer->FrontLeftAlpha;
break;
- case
GL_BACK_LEF
T:
+ case
BACK_LEFT_BI
T:
return ctx->DrawBuffer->BackLeftAlpha;
break;
return ctx->DrawBuffer->BackLeftAlpha;
break;
- case
GL_FRONT_RIGH
T:
+ case
FRONT_RIGHT_BI
T:
return ctx->DrawBuffer->FrontRightAlpha;
break;
return ctx->DrawBuffer->FrontRightAlpha;
break;
- case
GL_BACK_RIGH
T:
+ case
BACK_RIGHT_BI
T:
return ctx->DrawBuffer->BackRightAlpha;
break;
default:
return ctx->DrawBuffer->BackRightAlpha;
break;
default:
- _mesa_problem(ctx, "Bad
DriverDrawBuffer in _mesa_write_alpha_span
()");
- return
ctx->DrawBuffer->FrontLeftAlpha; /* aribitrary */
+ _mesa_problem(ctx, "Bad
CurrentBuffer in get_alpha_buffer
()");
+ return
(GLchan *) ctx->DrawBuffer->FrontLeftAlpha;
}
}
void
}
}
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;
CONST GLchan rgba[][4], const GLubyte mask[] )
{
GLchan *buffer, *aptr;
@@
-218,7
+222,7
@@
_mesa_write_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
void
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;
GLchan alpha, const GLubyte mask[] )
{
GLchan *buffer, *aptr;
@@
-244,7
+248,7
@@
_mesa_write_mono_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
void
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[] )
{
GLuint n, const GLint x[], const GLint y[],
CONST GLchan rgba[][4], const GLubyte mask[] )
{
@@
-271,7
+275,7
@@
_mesa_write_alpha_pixels( GLcontext *ctx,
void
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[] )
{
GLuint n, const GLint x[], const GLint y[],
GLchan alpha, const GLubyte mask[] )
{
@@
-299,7
+303,7
@@
_mesa_write_mono_alpha_pixels( GLcontext *ctx,
void
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;
GLuint n, GLint x, GLint y, GLchan rgba[][4] )
{
const GLchan *buffer, *aptr;
@@
-314,7
+318,7
@@
_mesa_read_alpha_span( GLcontext *ctx,
void
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[] )
{
GLuint n, const GLint x[], const GLint y[],
GLchan rgba[][4], const GLubyte mask[] )
{