summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-01-22 14:32:56 -0700
committerBrian Paul <brianp@vmware.com>2009-01-22 14:32:56 -0700
commit18634701ab137ff20d39e5ff9a0098b2e94ca09c (patch)
treebb9ac6f9eca90063f053c043ce463c8fc57f977e
parent132403ce44a1dea4390293a4b6057858b731bbcb (diff)
intel: fix a flipped image bug in intel_blit_framebuffer()
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c15
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 2ec929445a..124b8a58f2 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);