diff options
author | Eric Anholt <eric@anholt.net> | 2008-09-21 18:26:45 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-09-24 15:41:56 -0700 |
commit | 1e96c8736cb077655db820954f4c7c2849513122 (patch) | |
tree | 4b988c4d4e026d5f10e1b47158437d6576469093 | |
parent | 1410705be669ebe76171a51db14a2b6707098da9 (diff) |
i915: Fix overlapping CopyPixels with negative pixel zoom.
Fixes a failure in pixel-pos.c oglconform test.
(cherry picked from commit 15487e46a29377edc7ceceefabe9977f992ae01c)
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_pixel_copy.c | 18 |
1 files 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 1c72d6179d..ff65760900 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, |