gallium: Y-invert blit depending on framebuffer orientation
authorBrian <brian.paul@tungstengraphics.com>
Thu, 20 Mar 2008 20:20:25 +0000 (14:20 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 20 Mar 2008 21:04:08 +0000 (15:04 -0600)
src/mesa/state_tracker/st_cb_blit.c

index 64314a5078f3964c3d56568bb05187fce79c8dcc..63211d8b66e0a8814f46047512ba822501d7e667 100644 (file)
@@ -85,11 +85,14 @@ st_BlitFramebuffer(GLcontext *ctx,
       struct pipe_surface *srcSurf = srcRb->surface;
       struct pipe_surface *dstSurf = dstRb->surface;
 
-      srcY0 = srcRb->Base.Height - srcY0;
-      srcY1 = srcRb->Base.Height - srcY1;
-
-      dstY0 = dstRb->Base.Height - dstY0;
-      dstY1 = dstRb->Base.Height - dstY1;
+      if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
+         /* invert Y */
+         srcY0 = srcRb->Base.Height - srcY0;
+         srcY1 = srcRb->Base.Height - srcY1;
+
+         dstY0 = dstRb->Base.Height - dstY0;
+         dstY1 = dstRb->Base.Height - dstY1;
+      }
 
       util_blit_pixels(st->blit,
                        srcSurf, srcX0, srcY0, srcX1, srcY1,