summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_zoom.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-02-21 00:17:58 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-02-21 00:17:58 +0000
commitea20dfa7a8788870959f136bff0c3a20e4c2bb31 (patch)
tree4fe69d6b51f51e042db7129e1216c988bd603779 /src/mesa/swrast/s_zoom.c
parent19b3b0a0ff6a348b8b033fdb2c5c7790840fda5a (diff)
fix zoom/clipping bug 689964
Diffstat (limited to 'src/mesa/swrast/s_zoom.c')
-rw-r--r--src/mesa/swrast/s_zoom.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index a9c5eb8227..5727bc2876 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.20 2003/02/17 15:41:05 brianp Exp $ */
+/* $Id: s_zoom.c,v 1.21 2003/02/21 00:17:58 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -220,12 +220,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));
@@ -233,11 +236,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));