R1/2/3/4/5xx: fixed calculation of cliprects in CopyBuffer.
authorDennis Kasprzyk <onestone@opencompositing.org>
Thu, 29 May 2008 09:25:21 +0000 (11:25 +0200)
committerMichel Dänzer <michel@tungstengraphics.com>
Thu, 29 May 2008 09:25:21 +0000 (11:25 +0200)
src/mesa/drivers/dri/r200/r200_ioctl.c
src/mesa/drivers/dri/r300/radeon_ioctl.c
src/mesa/drivers/dri/radeon/radeon_ioctl.c

index 7008832965ae2a9818f897dbca7efb3ccfbad063..20482a4124471bccb7fb80371badf88a7ef29976 100644 (file)
@@ -477,16 +477,18 @@ void r200CopyBuffer( __DRIdrawablePrivate *dPriv,
             if (rect->y2 < b->y2)
                 b->y2 = rect->y2;
 
-            if (b->x1 < b->x2 && b->y1 < b->y2)
-                b++;
+            if (b->x1 >= b->x2 || b->y1 >= b->y2)
+                continue;
          }
-         else
-             b++;
 
+         b++;
          n++;
       }
       rmesa->sarea->nbox = n;
 
+      if (!n)
+        continue;
+
       ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_SWAP );
 
       if ( ret ) {
index 31a000d5e6699fa7b85d3efb5f5f5131b381c7d4..0c1a19507b230b18965e557385c2de1912bad3de 100644 (file)
@@ -215,16 +215,18 @@ void radeonCopyBuffer(__DRIdrawablePrivate * dPriv,
                        if (rect->y2 < b->y2)
                            b->y2 = rect->y2;
 
-                       if (b->x1 < b->x2 && b->y1 < b->y2)
-                           b++;
+                       if (b->x1 >= b->x2 || b->y1 >= b->y2)
+                           continue;
                    }
-                   else
-                       b++;
 
+                   b++;
                    n++;
                }
                radeon->sarea->nbox = n;
 
+               if (!n)
+                  continue;
+
                ret = drmCommandNone(radeon->dri.fd, DRM_RADEON_SWAP);
 
                if (ret) {
index 078ac9a29a2811d2c4b990984172f580e2737e98..446025b6312d49541db6b1ac53947e833bbf22e8 100644 (file)
@@ -919,16 +919,18 @@ void radeonCopyBuffer( __DRIdrawablePrivate *dPriv,
              if (rect->y2 < b->y2)
                  b->y2 = rect->y2;
 
-             if (b->x1 < b->x2 && b->y1 < b->y2)
-                 b++;
+             if (b->x1 >= b->x2 || b->y1 >= b->y2)
+                 continue;
          }
-         else
-             b++;
 
+         b++;
          n++;
       }
       rmesa->sarea->nbox = n;
 
+      if (!n)
+        continue;
+
       ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_SWAP );
 
       if ( ret ) {