summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2008-09-21 18:26:45 -0700
committerEric Anholt <[email protected]>2008-09-23 13:31:12 -0700
commit15487e46a29377edc7ceceefabe9977f992ae01c (patch)
tree7fce22ad50af825fc771e98b279249778f2c8592 /src/mesa/drivers
parentb9532f078a2fbf459b0403b6f656711f80ff83c2 (diff)
i915: Fix overlapping CopyPixels with negative pixel zoom.
Fixes a failure in pixel-pos.c oglconform test.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_copy.c18
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 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,