[PATCH 1/5] Delete unused fbWalkCompositeRegion()

Søren Sandmann sandmann at daimi.au.dk
Mon Nov 1 19:40:38 PDT 2010


From: Søren Sandmann Pedersen <ssp at redhat.com>

This function has not been used since most of the compositing was
moved to pixman. The only reason it has survived until now is that it
was part of the server ABI.
---
 fb/fbpict.c    |  106 --------------------------------------------------------
 fb/fbpict.h    |   17 ---------
 fb/wfbrename.h |    1 -
 3 files changed, 0 insertions(+), 124 deletions(-)

diff --git a/fb/fbpict.c b/fb/fbpict.c
index f7f1200..3bc141b 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -35,112 +35,6 @@
 #include "mipict.h"
 #include "fbpict.h"
 
-#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-
-void
-fbWalkCompositeRegion (CARD8 op,
-		       PicturePtr pSrc,
-		       PicturePtr pMask,
-		       PicturePtr pDst,
-		       INT16 xSrc,
-		       INT16 ySrc,
-		       INT16 xMask,
-		       INT16 yMask,
-		       INT16 xDst,
-		       INT16 yDst,
-		       CARD16 width,
-		       CARD16 height,
-		       Bool srcRepeat,
-		       Bool maskRepeat,
-		       CompositeFunc compositeRect)
-{
-    RegionRec	    region;
-    int		    n;
-    BoxPtr	    pbox;
-    int		    w, h, w_this, h_this;
-    int		    x_msk, y_msk, x_src, y_src, x_dst, y_dst;
-    
-    xDst += pDst->pDrawable->x;
-    yDst += pDst->pDrawable->y;
-    if (pSrc->pDrawable)
-    {
-        xSrc += pSrc->pDrawable->x;
-        ySrc += pSrc->pDrawable->y;
-    }
-    if (pMask && pMask->pDrawable)
-    {
-	xMask += pMask->pDrawable->x;
-	yMask += pMask->pDrawable->y;
-    }
-
-    if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst, xSrc, ySrc,
-				   xMask, yMask, xDst, yDst, width, height))
-        return;
-    
-    n = RegionNumRects (&region);
-    pbox = RegionRects (&region);
-    while (n--)
-    {
-	h = pbox->y2 - pbox->y1;
-	y_src = pbox->y1 - yDst + ySrc;
-	y_msk = pbox->y1 - yDst + yMask;
-	y_dst = pbox->y1;
-	while (h)
-	{
-	    h_this = h;
-	    w = pbox->x2 - pbox->x1;
-	    x_src = pbox->x1 - xDst + xSrc;
-	    x_msk = pbox->x1 - xDst + xMask;
-	    x_dst = pbox->x1;
-	    if (maskRepeat)
-	    {
-		y_msk = mod (y_msk - pMask->pDrawable->y, pMask->pDrawable->height);
-		if (h_this > pMask->pDrawable->height - y_msk)
-		    h_this = pMask->pDrawable->height - y_msk;
-		y_msk += pMask->pDrawable->y;
-	    }
-	    if (srcRepeat)
-	    {
-		y_src = mod (y_src - pSrc->pDrawable->y, pSrc->pDrawable->height);
-		if (h_this > pSrc->pDrawable->height - y_src)
-		    h_this = pSrc->pDrawable->height - y_src;
-		y_src += pSrc->pDrawable->y;
-	    }
-	    while (w)
-	    {
-		w_this = w;
-		if (maskRepeat)
-		{
-		    x_msk = mod (x_msk - pMask->pDrawable->x, pMask->pDrawable->width);
-		    if (w_this > pMask->pDrawable->width - x_msk)
-			w_this = pMask->pDrawable->width - x_msk;
-		    x_msk += pMask->pDrawable->x;
-		}
-		if (srcRepeat)
-		{
-		    x_src = mod (x_src - pSrc->pDrawable->x, pSrc->pDrawable->width);
-		    if (w_this > pSrc->pDrawable->width - x_src)
-			w_this = pSrc->pDrawable->width - x_src;
-		    x_src += pSrc->pDrawable->x;
-		}
-		(*compositeRect) (op, pSrc, pMask, pDst,
-				  x_src, y_src, x_msk, y_msk, x_dst, y_dst,
-				  w_this, h_this);
-		w -= w_this;
-		x_src += w_this;
-		x_msk += w_this;
-		x_dst += w_this;
-	    }
-	    h -= h_this;
-	    y_src += h_this;
-	    y_msk += h_this;
-	    y_dst += h_this;
-	}
-	pbox++;
-    }
-    RegionUninit(&region);
-}
-
 void
 fbComposite (CARD8      op,
 	     PicturePtr pSrc,
diff --git a/fb/fbpict.h b/fb/fbpict.h
index b89f90f..896cd01 100644
--- a/fb/fbpict.h
+++ b/fb/fbpict.h
@@ -442,23 +442,6 @@ typedef void	(*CompositeFunc) (CARD8      op,
 				  CARD16     width,
 				  CARD16     height);
 
-extern _X_EXPORT void
-fbWalkCompositeRegion (CARD8 op,
-		       PicturePtr pSrc,
-		       PicturePtr pMask,
-		       PicturePtr pDst,
-		       INT16 xSrc,
-		       INT16 ySrc,
-		       INT16 xMask,
-		       INT16 yMask,
-		       INT16 xDst,
-		       INT16 yDst,
-		       CARD16 width,
-		       CARD16 height,
-		       Bool srcRepeat,
-		       Bool maskRepeat,
-		       CompositeFunc compositeRect);
-
 /* fbtrap.c */
 
 extern _X_EXPORT void
diff --git a/fb/wfbrename.h b/fb/wfbrename.h
index c8e98c8..f3beed8 100644
--- a/fb/wfbrename.h
+++ b/fb/wfbrename.h
@@ -179,7 +179,6 @@
 #define fbUnmapWindow wfbUnmapWindow
 #define fbUnrealizeFont wfbUnrealizeFont
 #define fbValidateGC wfbValidateGC
-#define fbWalkCompositeRegion wfbWalkCompositeRegion
 #define fbWinPrivateKeyRec wfbWinPrivateKeyRec
 #define fbZeroLine wfbZeroLine
 #define fbZeroSegment wfbZeroSegment
-- 
1.7.3.1



More information about the xorg-devel mailing list