Mesa (arb_fbo): intel: fix a flipped image bug in intel_blit_framebuffer()

Brian Paul brianp at kemper.freedesktop.org
Thu Jan 22 21:42:49 UTC 2009


Module: Mesa
Branch: arb_fbo
Commit: 18634701ab137ff20d39e5ff9a0098b2e94ca09c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=18634701ab137ff20d39e5ff9a0098b2e94ca09c

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Jan 22 14:32:56 2009 -0700

intel: fix a flipped image bug in intel_blit_framebuffer()

---

 src/mesa/drivers/dri/intel/intel_fbo.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 2ec9294..124b8a5 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -676,6 +676,7 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
 /**
  * Called from glBlitFramebuffer().
  * For now, we're doing an approximation with glCopyPixels().
+ * XXX we need to bypass all the per-fragment operations, except scissor.
  */
 static void
 intel_blit_framebuffer(GLcontext *ctx,
@@ -708,6 +709,20 @@ intel_blit_framebuffer(GLcontext *ctx,
    ctx->Pixel.ZoomX = xFlip * (dstX1 - dstX0) / (srcX1 - srcY0);
    ctx->Pixel.ZoomY = yFlip * (dstY1 - dstY0) / (srcY1 - srcY0);
 
+   if (ctx->Pixel.ZoomX < 0.0F) {
+      dstX0 = MAX2(dstX0, dstX1);
+   }
+   else {
+      dstX0 = MIN2(dstX0, dstX1);
+   }
+
+   if (ctx->Pixel.ZoomY < 0.0F) {
+      dstY0 = MAX2(dstY0, dstY1);
+   }
+   else {
+      dstY0 = MIN2(dstY0, dstY1);
+   }
+
    if (mask & GL_COLOR_BUFFER_BIT) {
       ctx->Driver.CopyPixels(ctx, srcX0, srcY0, width, height,
                              dstX0, dstY0, GL_COLOR);




More information about the mesa-commit mailing list