From 8d0edf015d82a705796389890f6fe9b32e19414c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Sep 2005 03:20:15 +0000 Subject: Rewrite much of the pixel zoom code. Zoomed DrawPixels of packed depth/stencil works now. --- src/mesa/swrast/s_copypix.c | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) (limited to 'src/mesa/swrast/s_copypix.c') diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 4b8c7c4fa28..99989b0358c 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -226,19 +226,17 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) { drawRb->PutRow(ctx, drawRb, width, destx, dy, span.array->rgba, NULL); } - else if (zoom) { - span.x = destx; - span.y = dy; - span.end = width; - _swrast_write_zoomed_rgba_span(ctx, &span, - (CONST GLchan (*)[4])span.array->rgba, - desty, 0); - } else { span.x = destx; span.y = dy; span.end = width; - _swrast_write_rgba_span(ctx, &span); + if (zoom) { + _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, + (CONST GLchan (*)[4])span.array->rgba); + } + else { + _swrast_write_rgba_span(ctx, &span); + } } } @@ -368,19 +366,17 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) { drawRb->PutRow(ctx, drawRb, width, destx, dy, span.array->rgba, NULL); } - else if (zoom) { - span.x = destx; - span.y = dy; - span.end = width; - _swrast_write_zoomed_rgba_span(ctx, &span, - (CONST GLchan (*)[4]) span.array->rgba, - desty, 0); - } else { span.x = destx; span.y = dy; span.end = width; - _swrast_write_rgba_span(ctx, &span); + if (zoom) { + _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, + (CONST GLchan (*)[4]) span.array->rgba); + } + else { + _swrast_write_rgba_span(ctx, &span); + } } } @@ -481,7 +477,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, span.y = dy; span.end = width; if (zoom) - _swrast_write_zoomed_index_span(ctx, &span, desty, 0); + _swrast_write_zoomed_index_span(ctx, destx, desty, &span); else _swrast_write_index_span(ctx, &span); } @@ -585,14 +581,14 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, span.end = width; if (fb->Visual.rgbMode) { if (zoom) - _swrast_write_zoomed_rgba_span( ctx, &span, - (const GLchan (*)[4])span.array->rgba, desty, 0 ); + _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, + (const GLchan (*)[4]) span.array->rgba); else _swrast_write_rgba_span(ctx, &span); } else { if (zoom) - _swrast_write_zoomed_index_span( ctx, &span, desty, 0 ); + _swrast_write_zoomed_index_span(ctx, destx, desty, &span); else _swrast_write_index_span(ctx, &span); } @@ -686,8 +682,8 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, /* Write stencil values */ if (zoom) { - _swrast_write_zoomed_stencil_span( ctx, width, destx, dy, - stencil, desty, 0 ); + _swrast_write_zoomed_stencil_span(ctx, destx, desty, width, + destx, dy, stencil); } else { _swrast_write_stencil_span( ctx, width, destx, dy, stencil ); -- cgit v1.2.3