summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-09-21 17:34:56 +0000
committerBrian Paul <[email protected]>2002-09-21 17:34:56 +0000
commit551b65f13754e6760e5c272ff86f8873c9c13e5c (patch)
tree475b56da7ede2b0da6829a44650ec1e75c3f43ad /src/mesa/swrast
parentc5b995066020191982b2315fc45d05e068eee761 (diff)
GL_MESA_pack_invert
Diffstat (limited to 'src/mesa/swrast')
-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);