diff options
Diffstat (limited to 'src/mesa/swrast/s_copypix.c')
-rw-r--r-- | src/mesa/swrast/s_copypix.c | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index dbbfc58c6fd..bbe1081860d 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -94,7 +94,6 @@ static void copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLint row; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; const GLbitfield transferOps = ctx->_ImageTransferState; @@ -103,14 +102,10 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLfloat *dest, *tmpImage, *convImage; SWspan span; - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); + INIT_SPAN(span, GL_BITMAP); + _swrast_span_default_attribs(ctx, &span); + span.arrayMask = SPAN_RGBA; + span.arrayAttribs = FRAG_BIT_COL0; /* allocate space for GLfloat image */ tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); @@ -163,7 +158,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, /* write the new image */ for (row = 0; row < height; row++) { const GLfloat *src = convImage + row * width * 4; - GLvoid *rgba = (GLvoid *) span.array->attribs[FRAG_ATTRIB_COL0]; + GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; /* copy convolved colors into span array */ _mesa_memcpy(rgba, src, width * 4 * sizeof(GLfloat)); @@ -195,7 +190,6 @@ static void copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLfloat *tmpImage, *p; GLint sy, dy, stepy, row; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; @@ -240,13 +234,10 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, stepy = 1; } - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); + INIT_SPAN(span, GL_BITMAP); + _swrast_span_default_attribs(ctx, &span); + span.arrayMask = SPAN_RGBA; + span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */ if (overlapping) { tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); @@ -315,7 +306,6 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint *tmpImage,*p; GLint sy, dy, stepy; GLint j; @@ -328,7 +318,9 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, return; } - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX); + INIT_SPAN(span, GL_BITMAP); + _swrast_span_default_attribs(ctx, &span); + span.arrayMask = SPAN_INDEX; if (ctx->DrawBuffer == ctx->ReadBuffer) { overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, @@ -352,11 +344,6 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, stepy = 1; } - if (ctx->Depth.Test) - _swrast_span_default_z(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (overlapping) { GLint ssy = sy; tmpImage = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); @@ -452,7 +439,6 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_framebuffer *fb = ctx->ReadBuffer; struct gl_renderbuffer *readRb = fb->_DepthBuffer; GLfloat *p, *tmpImage; @@ -467,7 +453,9 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, return; } - INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z); + INIT_SPAN(span, GL_BITMAP); + _swrast_span_default_attribs(ctx, &span); + span.arrayMask = SPAN_Z; if (ctx->DrawBuffer == ctx->ReadBuffer) { overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, @@ -491,12 +479,6 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, stepy = 1; } - _swrast_span_default_color(ctx, &span); - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - _swrast_span_default_secondary_color(ctx, &span); - if (swrast->_FogEnabled) - _swrast_span_default_fog(ctx, &span); - if (overlapping) { GLint ssy = sy; tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat)); |