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

Jeff Muizelaar jeff at infidigm.net
Sat Jun 18 11:04:41 PDT 2005


This is the first of what will hopefully be a series of patches that
bring libpixman closer to the code in xserver/fb.

Index: src/icblt.c
===================================================================
RCS file: /cvs/cairo/libpixman/src/icblt.c,v
retrieving revision 1.5
diff -u -r1.5 icblt.c
--- src/icblt.c	2 Mar 2005 15:43:33 -0000	1.5
+++ src/icblt.c	18 Jun 2005 17:58:37 -0000
@@ -63,7 +63,31 @@
     int    destInvarient;
     int	    startbyte, endbyte;
     IcDeclareMergeRop ();
-
+ 
+    /* are we just copying multiples of 8 bits?  if so, run, forrest, run!
+       the memcpy()'s should be pluggable ala mplayer|xine - perhaps we can get
+       one of the above to give up their code for us.
+     */
+    if((pm==IC_ALLONES) && (alu==GXcopy) && !reverse && (srcX&7)==0 && (dstX&7)==0 && (width&7)==0)
+    {
+		uint8_t *isrc=(uint8_t *)srcLine;
+		uint8_t *idst=(uint8_t *)dstLine;
+		int sstride=srcStride*sizeof(pixman_bits_t);
+		int dstride=dstStride*sizeof(pixman_bits_t);
+		int j;
+		width>>=3;
+		isrc+=(srcX>>3);
+		idst+=(dstX>>3);
+		if(!upsidedown)
+			for(j=0;j<height;j++)
+				memcpy(idst+j*dstride, isrc+j*sstride, width);
+		else
+			for(j=(height-1);j>=0;j--)
+				memcpy(idst+j*dstride, isrc+j*sstride, width);
+	
+		return;
+    }
+    
 #ifdef IC_24BIT
     if (bpp == 24 && !IcCheck24Pix (pm))
     {
Index: src/icint.h
===================================================================
RCS file: /cvs/cairo/libpixman/src/icint.h,v
retrieving revision 1.28
diff -u -r1.28 icint.h
--- src/icint.h	3 Mar 2005 21:52:49 -0000	1.28
+++ src/icint.h	18 Jun 2005 17:58:41 -0000
@@ -61,6 +61,7 @@
 typedef unsigned int	Mask;
 
 
+#define GXcopy		0x3
 #define GXor		0x7
 #define ClipByChildren  0
 #define PolyEdgeSharp   0



More information about the cairo mailing list