From: Brian Date: Thu, 20 Mar 2008 20:20:25 +0000 (-0600) Subject: gallium: Y-invert blit depending on framebuffer orientation X-Git-Tag: 062012170305~17580^2~390^2~2179 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3aa8c660ffa9763dbdfdf2d75e991a08e41c29b6;p=profile%2Fivi%2Fmesa.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 64314a5..63211d8 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,