summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-05-04 13:53:55 +0000
committerBrian Paul <[email protected]>2000-05-04 13:53:55 +0000
commite70c623cf07f93a3e825116068d3108067988189 (patch)
treec27e4352b49cafa7bf464cd1e42fca04b47830c0 /src/mesa/main
parentad08108616b8ec0e64cc84ae2e93db44b33c1d5e (diff)
removed software alpha flag from GLvisual struct
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/buffers.c16
-rw-r--r--src/mesa/main/context.c14
-rw-r--r--src/mesa/main/context.h4
3 files changed, 18 insertions, 16 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 834940129ca..086dc93451b 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -1,4 +1,3 @@
-/* $Id: buffers.c,v 1.7 2000/04/22 01:03:22 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -240,6 +239,9 @@ void
_mesa_Clear( GLbitfield mask )
{
GET_CURRENT_CONTEXT(ctx);
+#ifdef PROFILE
+ GLdouble t0 = gl_time();
+#endif
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClear");
if (MESA_VERBOSE & VERBOSE_API)
@@ -295,10 +297,16 @@ _mesa_Clear( GLbitfield mask )
}
/* clear software-based alpha buffer(s) */
- if ( (mask & GL_COLOR_BUFFER_BIT) && ctx->Visual->SoftwareAlpha
+ if ( (mask & GL_COLOR_BUFFER_BIT)
+ && ctx->DrawBuffer->UseSoftwareAlphaBuffers
&& ctx->Color.ColorMask[RCOMP]) {
_mesa_clear_alpha_buffers( ctx );
}
+
+#ifdef PROFILE
+ ctx->ClearTime += gl_time() - t0;
+ ctx->ClearCount++;
+#endif
}
}
@@ -420,7 +428,7 @@ _mesa_DrawBuffer( GLenum mode )
/*
* Set current alpha buffer pointer
*/
- if (ctx->Visual->SoftwareAlpha) {
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers) {
if (ctx->Color.DriverDrawBuffer == GL_FRONT_LEFT)
ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontLeftAlpha;
else if (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT)
@@ -550,7 +558,7 @@ _mesa_ResizeBuffersMESA( void )
if (ctx->DrawBuffer->UseSoftwareAccumBuffer) {
_mesa_alloc_accum_buffer( ctx );
}
- if (ctx->Visual->SoftwareAlpha) {
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers) {
_mesa_alloc_alpha_buffers( ctx );
}
}
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 9f31dac2014..3533b822773 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.61 2000/04/22 01:05:00 brianp Exp $ */
+/* $Id: context.c,v 1.62 2000/05/04 13:53:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -95,7 +95,6 @@ struct immediate *_mesa_CurrentInput = NULL;
/*
* Allocate a new GLvisual object.
* Input: rgbFlag - GL_TRUE=RGB(A) mode, GL_FALSE=Color Index mode
- * alphaFlag - alloc software alpha buffers?
* dbFlag - double buffering?
* stereoFlag - stereo buffer?
* depthBits - requested bits per depth buffer value
@@ -112,7 +111,6 @@ struct immediate *_mesa_CurrentInput = NULL;
*/
GLvisual *
_mesa_create_visual( GLboolean rgbFlag,
- GLboolean alphaFlag,
GLboolean dbFlag,
GLboolean stereoFlag,
GLint redBits,
@@ -130,7 +128,7 @@ _mesa_create_visual( GLboolean rgbFlag,
{
GLvisual *vis = (GLvisual *) CALLOC( sizeof(GLvisual) );
if (vis) {
- if (!_mesa_initialize_visual(vis, rgbFlag, alphaFlag, dbFlag, stereoFlag,
+ if (!_mesa_initialize_visual(vis, rgbFlag, dbFlag, stereoFlag,
redBits, greenBits, blueBits, alphaBits,
indexBits, depthBits, stencilBits,
accumRedBits, accumGreenBits,
@@ -153,7 +151,6 @@ _mesa_create_visual( GLboolean rgbFlag,
GLboolean
_mesa_initialize_visual( GLvisual *vis,
GLboolean rgbFlag,
- GLboolean alphaFlag,
GLboolean dbFlag,
GLboolean stereoFlag,
GLint redBits,
@@ -202,7 +199,7 @@ _mesa_initialize_visual( GLvisual *vis,
vis->RedBits = redBits;
vis->GreenBits = greenBits;
vis->BlueBits = blueBits;
- vis->AlphaBits = alphaFlag ? (8 * sizeof(GLubyte)) : alphaBits;
+ vis->AlphaBits = alphaBits;
vis->IndexBits = indexBits;
vis->DepthBits = depthBits;
@@ -212,8 +209,6 @@ _mesa_initialize_visual( GLvisual *vis,
vis->AccumAlphaBits = (accumAlphaBits > 0) ? (8 * sizeof(GLaccum)) : 0;
vis->StencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0;
- vis->SoftwareAlpha = alphaFlag;
-
if (depthBits == 0) {
/* Special case. Even if we don't have a depth buffer we need
* good values for DepthMax for Z vertex transformation purposes.
@@ -245,7 +240,8 @@ gl_create_visual( GLboolean rgbFlag,
GLint blueBits,
GLint alphaBits )
{
- return _mesa_create_visual(rgbFlag, alphaFlag, dbFlag, stereoFlag,
+ (void) alphaFlag;
+ return _mesa_create_visual(rgbFlag, dbFlag, stereoFlag,
redBits, greenBits, blueBits, alphaBits,
indexBits, depthBits, stencilBits,
accumBits, accumBits, accumBits, accumBits, 0);
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index ce8be2e0f20..581931153ce 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -1,4 +1,4 @@
-/* $Id: context.h,v 1.16 2000/04/22 01:05:00 brianp Exp $ */
+/* $Id: context.h,v 1.17 2000/05/04 13:53:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -59,7 +59,6 @@
*/
extern GLvisual *
_mesa_create_visual( GLboolean rgbFlag,
- GLboolean alphaFlag,
GLboolean dbFlag,
GLboolean stereoFlag,
GLint redBits,
@@ -78,7 +77,6 @@ _mesa_create_visual( GLboolean rgbFlag,
extern GLboolean
_mesa_initialize_visual( GLvisual *v,
GLboolean rgbFlag,
- GLboolean alphaFlag,
GLboolean dbFlag,
GLboolean stereoFlag,
GLint redBits,