summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_readpix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_readpix.c')
-rw-r--r--src/mesa/swrast/s_readpix.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index f925e791162..562d8718463 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -1,4 +1,4 @@
-/* $Id: s_readpix.c,v 1.15 2002/07/09 01:22:52 brianp Exp $ */
+/* $Id: s_readpix.c,v 1.16 2002/09/21 17:34:56 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -279,8 +279,15 @@ read_fast_rgba_pixels( GLcontext *ctx,
if (0) {
#endif
GLchan *dest = (GLchan *) pixels
- + (skipRows * rowLength + skipPixels) * 4;
+ + (skipRows * rowLength + skipPixels) * 4;
GLint row;
+
+ if (packing->Invert) {
+ /* start at top and go down */
+ dest += (readHeight - 1) * rowLength * 4;
+ rowLength = -rowLength;
+ }
+
for (row=0; row<readHeight; row++) {
(*swrast->Driver.ReadRGBASpan)(ctx, readWidth, srcX, srcY,
(GLchan (*)[4]) dest);