summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_readpix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_readpix.c')
-rw-r--r--src/mesa/swrast/s_readpix.c59
1 files changed, 2 insertions, 57 deletions
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 1de481248b1..b0a3d36420a 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -26,7 +26,6 @@
#include "main/glheader.h"
#include "main/bufferobj.h"
#include "main/colormac.h"
-#include "main/convolve.h"
#include "main/feedback.h"
#include "main/formats.h"
#include "main/image.h"
@@ -326,57 +325,7 @@ read_rgba_pixels( GLcontext *ctx,
/* width should never be > MAX_WIDTH since we did clipping earlier */
ASSERT(width <= MAX_WIDTH);
- if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
- GLfloat *dest, *src, *tmpImage, *convImage;
- GLint row;
-
- tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- if (!tmpImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
- return;
- }
- convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- if (!convImage) {
- free(tmpImage);
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
- return;
- }
-
- /* read full RGBA, FLOAT image */
- dest = tmpImage;
- for (row = 0; row < height; row++, y++) {
- _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, dest);
- _mesa_apply_rgba_transfer_ops(ctx,
- transferOps & IMAGE_PRE_CONVOLUTION_BITS,
- width, (GLfloat (*)[4]) dest);
- dest += width * 4;
- }
-
- /* do convolution */
- if (ctx->Pixel.Convolution2DEnabled) {
- _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage);
- }
- else {
- ASSERT(ctx->Pixel.Separable2DEnabled);
- _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage);
- }
- free(tmpImage);
-
- /* finish transfer ops and pack the resulting image */
- src = convImage;
- for (row = 0; row < height; row++) {
- GLvoid *dest;
- dest = _mesa_image_address2d(packing, pixels, width, height,
- format, type, row, 0);
- _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) src,
- format, type, dest, packing,
- transferOps & IMAGE_POST_CONVOLUTION_BITS);
- src += width * 4;
- }
- free(convImage);
- }
- else {
- /* no convolution */
+ do {
const GLint dstStride
= _mesa_image_row_stride(packing, width, format, type);
GLfloat (*rgba)[4] = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0];
@@ -385,10 +334,6 @@ read_rgba_pixels( GLcontext *ctx,
= (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
format, type, 0, 0);
- /* make sure we don't apply 1D convolution */
- transferOps &= ~(IMAGE_CONVOLUTION_BIT |
- IMAGE_POST_CONVOLUTION_SCALE_BIAS);
-
for (row = 0; row < height; row++, y++) {
/* Get float rgba pixels */
@@ -407,7 +352,7 @@ read_rgba_pixels( GLcontext *ctx,
dst += dstStride;
}
- }
+ } while (0);
}