From 15487e46a29377edc7ceceefabe9977f992ae01c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 21 Sep 2008 18:26:45 -0700 Subject: [PATCH] i915: Fix overlapping CopyPixels with negative pixel zoom. Fixes a failure in pixel-pos.c oglconform test. --- src/mesa/drivers/dri/intel/intel_pixel_copy.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index 3fb8a3104c3..1b3cb5adcb7 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -135,10 +135,20 @@ do_texture_copypixels(GLcontext * ctx, srcbox.x2 = srcx + width; srcbox.y2 = srcy + height; - dstbox.x1 = dstx; - dstbox.y1 = dsty; - dstbox.x2 = dstx + width * ctx->Pixel.ZoomX; - dstbox.y2 = dsty + height * ctx->Pixel.ZoomY; + if (ctx->Pixel.ZoomX > 0) { + dstbox.x1 = dstx; + dstbox.x2 = dstx + width * ctx->Pixel.ZoomX; + } else { + dstbox.x1 = dstx + width * ctx->Pixel.ZoomX; + dstbox.x2 = dstx; + } + if (ctx->Pixel.ZoomY > 0) { + dstbox.y1 = dsty; + dstbox.y2 = dsty + height * ctx->Pixel.ZoomY; + } else { + dstbox.y1 = dsty + height * ctx->Pixel.ZoomY; + dstbox.y2 = dsty; + } DBG("src %d,%d %d,%d\n", srcbox.x1, srcbox.y1, srcbox.x2, srcbox.y2); DBG("dst %d,%d %d,%d (%dx%d) (%f,%f)\n", dstbox.x1, dstbox.y1, dstbox.x2, dstbox.y2, -- 2.30.2