[cairo] [PATCH] more xserver/fb -> libpixman merging

Jeff Muizelaar jeff at infidigm.net
Sat Jun 18 13:48:53 PDT 2005


Some more merging...

This one comes from:

 630. Fix incorrect datatype for the pixmap width in
      fbCompositeSrcAdd_8000x8000(), and add some small optimisations
      (#A.1423, Keith Packard).

Index: ic.c
===================================================================
RCS file: /cvs/cairo/libpixman/src/ic.c,v
retrieving revision 1.20
diff -u -r1.20 ic.c
--- ic.c	27 Apr 2005 20:02:20 -0000	1.20
+++ ic.c	18 Jun 2005 20:43:38 -0000
@@ -681,13 +681,17 @@
 	while (w--)
 	{
 	    s = *src++;
-	    if (s != 0xff)
+	    if (s)
 	    {
-		d = *dst;
-		t = d + s;
-		s = t | (0 - (t >> 8));
+		if (s != 0xff)
+		{
+		    d = *dst;
+		    t = d + s;
+		    s = t | (0 - (t >> 8));
+		}
+		*dst = s;
 	    }
-	    *dst++ = s;
+	    dst++;
 	}
     }
 }
@@ -728,19 +732,23 @@
 	while (w--)
 	{
 	    s = *src++;
-	    if (s != 0xffffffff)
+	    if (s)
 	    {
-		d = *dst;
-		if (d)
+		if (s != 0xffffffff)
 		{
-		    m = IcAdd(s,d,0,t);
-		    n = IcAdd(s,d,8,t);
-		    o = IcAdd(s,d,16,t);
-		    p = IcAdd(s,d,24,t);
-		    s = m|n|o|p;
+		    d = *dst;
+		    if (d)
+		    {
+			m = IcAdd(s,d,0,t);
+			n = IcAdd(s,d,8,t);
+			o = IcAdd(s,d,16,t);
+			p = IcAdd(s,d,24,t);
+			s = m|n|o|p;
+		    }
 		}
+		*dst = s;
 	    }
-	    *dst++ = s;
+	    dst++;
 	}
     }
 }



More information about the cairo mailing list