Mesa (master): i915: Fix overlapping CopyPixels with negative pixel zoom.

Eric Anholt anholt at kemper.freedesktop.org
Tue Sep 23 22:22:16 UTC 2008


Module: Mesa
Branch: master
Commit: 15487e46a29377edc7ceceefabe9977f992ae01c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=15487e46a29377edc7ceceefabe9977f992ae01c

Author: Eric Anholt <eric at anholt.net>
Date:   Sun Sep 21 18:26:45 2008 -0700

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 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 3fb8a31..1b3cb5a 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,




More information about the mesa-commit mailing list