Huw Davies : winex11: Simplify rectangle operations.

Alexandre Julliard julliard at winehq.org
Mon Aug 22 13:29:07 CDT 2011


Module: wine
Branch: master
Commit: 6d0f81336ab27e1df13f0903428c49b22b7cda16
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6d0f81336ab27e1df13f0903428c49b22b7cda16

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri Aug 19 16:23:57 2011 +0100

winex11: Simplify rectangle operations.

---

 dlls/winex11.drv/bitblt.c |   35 +++++++----------------------------
 1 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c
index 7f314c2..2e851c0 100644
--- a/dlls/winex11.drv/bitblt.c
+++ b/dlls/winex11.drv/bitblt.c
@@ -916,34 +916,13 @@ static int BITBLT_GetSrcAreaStretch( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE
     RECT rectDst = dst->visrect;
     int fg, bg;
 
-    rectSrc.left   -= src->x;
-    rectSrc.right  -= src->x;
-    rectSrc.top    -= src->y;
-    rectSrc.bottom -= src->y;
-    rectDst.left   -= dst->x;
-    rectDst.right  -= dst->x;
-    rectDst.top    -= dst->y;
-    rectDst.bottom -= dst->y;
-    if (src->width < 0)
-    {
-        rectSrc.left  -= src->width;
-        rectSrc.right -= src->width;
-    }
-    if (dst->width < 0)
-    {
-        rectDst.left  -= dst->width;
-        rectDst.right -= dst->width;
-    }
-    if (src->height < 0)
-    {
-        rectSrc.top    -= src->height;
-        rectSrc.bottom -= src->height;
-    }
-    if (dst->height < 0)
-    {
-        rectDst.top    -= dst->height;
-        rectDst.bottom -= dst->height;
-    }
+    OffsetRect( &rectSrc, -src->x, -src->y );
+    OffsetRect( &rectDst, -dst->x, -dst->y );
+
+    if (src->width < 0)  OffsetRect( &rectSrc, -src->width, 0 );
+    if (dst->width < 0)  OffsetRect( &rectDst, -dst->width, 0 );
+    if (src->height < 0) OffsetRect( &rectSrc, 0, -src->height );
+    if (dst->height < 0) OffsetRect( &rectDst, 0, -dst->height );
 
     get_colors(physDevDst, physDevSrc, &fg, &bg);
     wine_tsx11_lock();




More information about the wine-cvs mailing list