[xserver-commit] xserver/fb fbblt.c,1.13,1.14

Jaymz Julian xserver-commit@pdx.freedesktop.org


Committed by: jaymz

Update of /cvs/xserver/xserver/fb
In directory pdx:/tmp/cvs-serv3517/fb

Modified Files:
	fbblt.c 
Log Message:
Hrm, it appears that maybe my net connection is finally working properly
again.  Small change to the conditions of the memcpy() blit code to all
it if both the start and end points of src and dst are aligned to eight
bits, even if the bpp isn't.



Index: fbblt.c
===================================================================
RCS file: /cvs/xserver/xserver/fb/fbblt.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- fbblt.c	28 Dec 2003 05:34:05 -0000	1.13
+++ fbblt.c	4 Feb 2004 06:16:06 -0000	1.14
@@ -68,8 +68,11 @@
     Bool    destInvarient;
     int	    startbyte, endbyte;
     FbDeclareMergeRop ();
-
-    if((pm==FB_ALLONES) && (alu==GXcopy) && !reverse && !upsidedown && ((bpp&7)==0))
+ 
+    // 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==FB_ALLONES) && (alu==GXcopy) && !reverse && (srcX&7)==0 && (dstX&7)==0 && (width&7)==0)
     {
 		CARD8 *isrc=(CARD8 *)srcLine;
 		CARD8 *idst=(CARD8 *)dstLine;
@@ -79,8 +82,12 @@
 		width>>=3;
 		isrc+=(srcX>>3);
 		idst+=(dstX>>3);
-		for(j=0;j<height;j++)
-			memcpy(idst+j*dstride, isrc+j*sstride, width);
+		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;
     }