aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_blit.c
diff options
context:
space:
mode:
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;