diff options
author | Brian Paul <[email protected]> | 2002-03-19 16:42:41 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-03-19 16:42:41 +0000 |
commit | af3f3080f927b4ac4f78aaa8b065aa4983baf89a (patch) | |
tree | f338f69bc106502d2cd0ec1f214a1ce65c69df24 /src/mesa/swrast | |
parent | bb47715320cda3ebd55d0e510882117b939f0f71 (diff) |
Use MESA_PBUFFER_ALLOC/FREE macros to allocate all framebuffer and texture
memory. These can be overridden by applications which need to manage this
memory specially. Contributed by Gerk Huisma.
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_accum.c | 7 | ||||
-rw-r--r-- | src/mesa/swrast/s_alphabuf.c | 18 | ||||
-rw-r--r-- | src/mesa/swrast/s_depth.c | 6 | ||||
-rw-r--r-- | src/mesa/swrast/s_stencil.c | 6 |
4 files changed, 18 insertions, 19 deletions
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index 3dcca858cbb..3443614df27 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -1,4 +1,4 @@ -/* $Id: s_accum.c,v 1.13.2.1 2002/03/16 00:50:14 brianp Exp $ */ +/* $Id: s_accum.c,v 1.13.2.2 2002/03/19 16:42:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -73,13 +73,13 @@ _mesa_alloc_accum_buffer( GLframebuffer *buffer ) GLint n; if (buffer->Accum) { - FREE( buffer->Accum ); + MESA_PBUFFER_FREE( buffer->Accum ); buffer->Accum = NULL; } /* allocate accumulation buffer if not already present */ n = buffer->Width * buffer->Height * 4 * sizeof(GLaccum); - buffer->Accum = (GLaccum *) MALLOC( n ); + buffer->Accum = (GLaccum *) MESA_PBUFFER_ALLOC( n ); if (!buffer->Accum) { /* unable to setup accumulation buffer */ _mesa_error( NULL, GL_OUT_OF_MEMORY, "glAccum" ); @@ -242,7 +242,6 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value, GLchan rgba[MAX_WIDTH][4]; const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask); - if (SWRAST_CONTEXT(ctx)->NewState) _swrast_validate_derived( ctx ); diff --git a/src/mesa/swrast/s_alphabuf.c b/src/mesa/swrast/s_alphabuf.c index 7d70ab23bb5..6992fd2d50b 100644 --- a/src/mesa/swrast/s_alphabuf.c +++ b/src/mesa/swrast/s_alphabuf.c @@ -1,4 +1,4 @@ -/* $Id: s_alphabuf.c,v 1.8.2.1 2002/03/16 00:50:14 brianp Exp $ */ +/* $Id: s_alphabuf.c,v 1.8.2.2 2002/03/19 16:42:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -57,9 +57,9 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer ) ASSERT(buffer->UseSoftwareAlphaBuffers); if (buffer->FrontLeftAlpha) { - FREE( buffer->FrontLeftAlpha ); + MESA_PBUFFER_FREE( buffer->FrontLeftAlpha ); } - buffer->FrontLeftAlpha = (GLchan *) MALLOC( bytes ); + buffer->FrontLeftAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes ); if (!buffer->FrontLeftAlpha) { /* out of memory */ _mesa_error( NULL, GL_OUT_OF_MEMORY, @@ -68,9 +68,9 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer ) if (buffer->Visual.doubleBufferMode) { if (buffer->BackLeftAlpha) { - FREE( buffer->BackLeftAlpha ); + MESA_PBUFFER_FREE( buffer->BackLeftAlpha ); } - buffer->BackLeftAlpha = (GLchan *) MALLOC( bytes ); + buffer->BackLeftAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes ); if (!buffer->BackLeftAlpha) { /* out of memory */ _mesa_error( NULL, GL_OUT_OF_MEMORY, @@ -80,9 +80,9 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer ) if (buffer->Visual.stereoMode) { if (buffer->FrontRightAlpha) { - FREE( buffer->FrontRightAlpha ); + MESA_PBUFFER_FREE( buffer->FrontRightAlpha ); } - buffer->FrontRightAlpha = (GLchan *) MALLOC( bytes ); + buffer->FrontRightAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes ); if (!buffer->FrontRightAlpha) { /* out of memory */ _mesa_error( NULL, GL_OUT_OF_MEMORY, @@ -91,9 +91,9 @@ _mesa_alloc_alpha_buffers( GLframebuffer *buffer ) if (buffer->Visual.doubleBufferMode) { if (buffer->BackRightAlpha) { - FREE( buffer->BackRightAlpha ); + MESA_PBUFFER_FREE( buffer->BackRightAlpha ); } - buffer->BackRightAlpha = (GLchan *) MALLOC( bytes ); + buffer->BackRightAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes ); if (!buffer->BackRightAlpha) { /* out of memory */ _mesa_error( NULL, GL_OUT_OF_MEMORY, diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 30301ed92b8..d7814f9ae7e 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -1,4 +1,4 @@ -/* $Id: s_depth.c,v 1.9.2.1 2002/03/16 00:50:14 brianp Exp $ */ +/* $Id: s_depth.c,v 1.9.2.2 2002/03/19 16:42:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1494,7 +1494,7 @@ _mesa_alloc_depth_buffer( GLframebuffer *buffer ) /* deallocate current depth buffer if present */ if (buffer->DepthBuffer) { - FREE(buffer->DepthBuffer); + MESA_PBUFFER_FREE(buffer->DepthBuffer); buffer->DepthBuffer = NULL; } @@ -1504,7 +1504,7 @@ _mesa_alloc_depth_buffer( GLframebuffer *buffer ) else bytesPerValue = sizeof(GLuint); - buffer->DepthBuffer =MALLOC(buffer->Width * buffer->Height * bytesPerValue); + buffer->DepthBuffer = MESA_PBUFFER_ALLOC(buffer->Width * buffer->Height * bytesPerValue); if (!buffer->DepthBuffer) { /* out of memory */ diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index d942bd137dd..4635d707716 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -1,4 +1,4 @@ -/* $Id: s_stencil.c,v 1.12.2.2 2002/03/16 00:50:14 brianp Exp $ */ +/* $Id: s_stencil.c,v 1.12.2.3 2002/03/19 16:42:42 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1113,12 +1113,12 @@ _mesa_alloc_stencil_buffer( GLframebuffer *buffer ) { /* deallocate current stencil buffer if present */ if (buffer->Stencil) { - FREE(buffer->Stencil); + MESA_PBUFFER_FREE(buffer->Stencil); buffer->Stencil = NULL; } /* allocate new stencil buffer */ - buffer->Stencil = (GLstencil *) MALLOC(buffer->Width * buffer->Height + buffer->Stencil = (GLstencil *) MESA_PBUFFER_ALLOC(buffer->Width * buffer->Height * sizeof(GLstencil)); if (!buffer->Stencil) { /* out of memory */ |