diff options
author | Brian Paul <[email protected]> | 2003-02-21 00:17:48 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-02-21 00:17:48 +0000 |
commit | 3de75f6f68219e23842bf7ae671dbd44474e8e40 (patch) | |
tree | 286c49e6c87b5f0ad76db0217c7ac509f00f240e | |
parent | d1f324a7795dd5541fff337ce473e9fd0e49d3d7 (diff) |
fix zoom/clipping bug 689964
-rw-r--r-- | src/mesa/swrast/s_zoom.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 10539d922b1..41c33091747 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -1,4 +1,4 @@ -/* $Id: s_zoom.c,v 1.18.2.1 2003/02/17 15:41:33 brianp Exp $ */ +/* $Id: s_zoom.c,v 1.18.2.2 2003/02/21 00:17:48 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -207,12 +207,15 @@ zoom_span( GLcontext *ctx, const struct sw_span *span, if (format == GL_RGBA || format == GL_RGB) { /* Writing the span may modify the colors, so make a backup now if we're * going to call _mesa_write_zoomed_span() more than once. + * Also, clipping may change the span end value, so store it as well. */ + const GLint end = zoomed.end; /* save */ if (r1 - r0 > 1) { MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * 4 * sizeof(GLchan)); } for (zoomed.y = r0; zoomed.y < r1; zoomed.y++) { _mesa_write_rgba_span(ctx, &zoomed); + zoomed.end = end; /* restore */ if (r1 - r0 > 1) { /* restore the colors */ MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end*4 * sizeof(GLchan)); @@ -220,11 +223,13 @@ zoom_span( GLcontext *ctx, const struct sw_span *span, } } else if (format == GL_COLOR_INDEX) { + const GLint end = zoomed.end; /* save */ if (r1 - r0 > 1) { MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); } for (zoomed.y = r0; zoomed.y < r1; zoomed.y++) { _mesa_write_index_span(ctx, &zoomed); + zoomed.end = end; /* restore */ if (r1 - r0 > 1) { /* restore the colors */ MEMCPY(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); |