aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_blit.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-04-02 14:47:58 +0000
committermarha <marha@users.sourceforge.net>2010-04-02 14:47:58 +0000
commit7933658107276f9d5491f8736a743cf8f8bbd5f2 (patch)
treef2893a761364e7abc9d934e9c5427e5cf5190c7a /mesalib/src/mesa/swrast/s_blit.c
parent83fa9a9811e2c18cffd83a020757f7fb51ffddaa (diff)
downloadvcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.tar.gz
vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.tar.bz2
vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.zip
Updated to following packages:
mesa-7.8
Diffstat (limited to 'mesalib/src/mesa/swrast/s_blit.c')
-rw-r--r--mesalib/src/mesa/swrast/s_blit.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/mesalib/src/mesa/swrast/s_blit.c b/mesalib/src/mesa/swrast/s_blit.c
index 8303e4deb..753f3136f 100644
--- a/mesalib/src/mesa/swrast/s_blit.c
+++ b/mesalib/src/mesa/swrast/s_blit.c
@@ -24,6 +24,7 @@
#include "main/glheader.h"
+#include "main/condrender.h"
#include "main/image.h"
#include "main/macros.h"
#include "s_context.h"
@@ -197,14 +198,14 @@ blit_nearest(GLcontext *ctx,
}
/* allocate the src/dst row buffers */
- srcBuffer = _mesa_malloc(pixelSize * srcWidth);
+ srcBuffer = malloc(pixelSize * srcWidth);
if (!srcBuffer) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
return;
}
- dstBuffer = _mesa_malloc(pixelSize * dstWidth);
+ dstBuffer = malloc(pixelSize * dstWidth);
if (!dstBuffer) {
- _mesa_free(srcBuffer);
+ free(srcBuffer);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
return;
}
@@ -234,8 +235,8 @@ blit_nearest(GLcontext *ctx,
drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL);
}
- _mesa_free(srcBuffer);
- _mesa_free(dstBuffer);
+ free(srcBuffer);
+ free(dstBuffer);
}
@@ -365,21 +366,21 @@ blit_linear(GLcontext *ctx,
/* Allocate the src/dst row buffers.
* Keep two adjacent src rows around for bilinear sampling.
*/
- srcBuffer0 = _mesa_malloc(pixelSize * srcWidth);
+ srcBuffer0 = malloc(pixelSize * srcWidth);
if (!srcBuffer0) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
return;
}
- srcBuffer1 = _mesa_malloc(pixelSize * srcWidth);
+ srcBuffer1 = malloc(pixelSize * srcWidth);
if (!srcBuffer1) {
- _mesa_free(srcBuffer0);
+ free(srcBuffer0);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
return;
}
- dstBuffer = _mesa_malloc(pixelSize * dstWidth);
+ dstBuffer = malloc(pixelSize * dstWidth);
if (!dstBuffer) {
- _mesa_free(srcBuffer0);
- _mesa_free(srcBuffer1);
+ free(srcBuffer0);
+ free(srcBuffer1);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
return;
}
@@ -443,9 +444,9 @@ blit_linear(GLcontext *ctx,
drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL);
}
- _mesa_free(srcBuffer0);
- _mesa_free(srcBuffer1);
- _mesa_free(dstBuffer);
+ free(srcBuffer0);
+ free(srcBuffer1);
+ free(dstBuffer);
}
@@ -534,7 +535,7 @@ simple_blit(GLcontext *ctx,
}
/* allocate the row buffer */
- rowBuffer = _mesa_malloc(bytesPerRow);
+ rowBuffer = malloc(bytesPerRow);
if (!rowBuffer) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT");
return;
@@ -547,7 +548,7 @@ simple_blit(GLcontext *ctx,
dstY += yStep;
}
- _mesa_free(rowBuffer);
+ free(rowBuffer);
}
@@ -567,6 +568,9 @@ _swrast_BlitFramebuffer(GLcontext *ctx,
};
GLint i;
+ if (!_mesa_check_conditional_render(ctx))
+ return; /* don't clear */
+
if (!ctx->DrawBuffer->_NumColorDrawBuffers)
return;