From: Brian Date: Thu, 20 Mar 2008 20:20:25 +0000 (-0600) Subject: gallium: Y-invert blit depending on framebuffer orientation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3aa8c660ffa9763dbdfdf2d75e991a08e41c29b6;p=mesa.git gallium: Y-invert blit depending on framebuffer orientation --- diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index 64314a5078f..63211d8b66e 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -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,