diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-29 03:20:15 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-09-29 03:20:15 +0000 |
commit | 8d0edf015d82a705796389890f6fe9b32e19414c (patch) | |
tree | f62127d12108175d8b1fa85bd3f797e1e49de70e /src/mesa/swrast/s_copypix.c | |
parent | 5208867f12abd4b13c517e8cd006afde6fadbed8 (diff) |
Rewrite much of the pixel zoom code.
Zoomed DrawPixels of packed depth/stencil works now.
Diffstat (limited to 'src/mesa/swrast/s_copypix.c')
-rw-r--r-- | src/mesa/swrast/s_copypix.c | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 4b8c7c4fa2..99989b0358 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 ); |