[xserver-commit] xserver/mi misprite.c,3.13.2.1,3.13.2.2

Keith Packard xserver-commit@pdx.freedesktop.org
Wed, 22 Oct 2003 14:23:47 -0700


Committed by: keithp

Update of /cvs/xserver/xserver/mi
In directory pdx:/tmp/cvs-serv16883/mi

Modified Files:
      Tag: xfixes_2_branch
	misprite.c 
Log Message:
	* hw/kdrive/mach64/mach64draw.c: (mach64Setup), (mach64DoneSolid),
	(mach64DoneCopy):
	Added SYNC_ALWAYS for debugging (sync after each operation)
	* mi/misprite.c: (miSpriteReportDamage), (miSpriteCopyWindow):
	Add SPRITE_DEBUG_ENABLE to help debug cursor problems
	* miext/damage/damage.c: (damageDamageRegion), (damageDamageBox),
	(damageDamageRect), (damageValidateGC):
	Leave all GCs redirected through Damage GC ops so that adding
	damage doesn't require revalidating all GCs (that would require
	walking the window tree and resetting all serial numbers).
	Add DAMAGE_DEBUG_ENABLE to help debug damage problems


Index: misprite.c
===================================================================
RCS file: /cvs/xserver/xserver/mi/misprite.c,v
retrieving revision 3.13.2.1
retrieving revision 3.13.2.2
diff -u -d -r3.13.2.1 -r3.13.2.2
--- misprite.c	22 Oct 2003 06:00:50 -0000	3.13.2.1
+++ misprite.c	22 Oct 2003 21:23:44 -0000	3.13.2.2
@@ -56,6 +56,13 @@
 #endif
 # include   "damage.h"
 
+#define SPRITE_DEBUG_ENABLE 0
+#if SPRITE_DEBUG_ENABLE
+#define SPRITE_DEBUG(x)	ErrorF x
+#else
+#define SPRITE_DEBUG(x)
+#endif
+
 /*
  * screen wrappers
  */
@@ -128,7 +135,10 @@
     
     if (pScreenPriv->isUp &&
 	RECT_IN_REGION (pScreen, pRegion, &pScreenPriv->saved) != rgnOUT)
+    {
+	SPRITE_DEBUG(("Damage remove\n"));
 	miSpriteRemoveCursor (pScreen);
+    }
 }
 
 /*
@@ -279,6 +289,7 @@
         pScreenPriv->isUp &&
 	ORG_OVERLAP(&pScreenPriv->saved,pDrawable->x,pDrawable->y, sx, sy, w, h))
     {
+	SPRITE_DEBUG (("GetImage remove\n"));
 	miSpriteRemoveCursor (pScreen);
     }
 
@@ -322,6 +333,7 @@
 	    if (SPN_OVERLAP(&pScreenPriv->saved,pts->y+yorg,
 			     pts->x+xorg,*widths))
 	    {
+		SPRITE_DEBUG (("GetSpans remove\n"));
 		miSpriteRemoveCursor (pScreen);
 		break;
 	    }
@@ -349,6 +361,7 @@
 	ORG_OVERLAP(&pScreenPriv->saved, pDrawable->x, pDrawable->y,
 		    x, y, width, height))
     {
+	SPRITE_DEBUG (("SourceValidate remove\n"));
 	miSpriteRemoveCursor (pScreen);
     }
 
@@ -367,9 +380,15 @@
     SCREEN_PROLOGUE (pScreen, CopyWindow);
 
     pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr;
+    /*
+     * Damage will take care of destination check
+     */
     if (pScreenPriv->isUp &&
 	RECT_IN_REGION (pScreen, prgnSrc, &pScreenPriv->saved) != rgnOUT)
+    {
+	SPRITE_DEBUG (("CopyWindow remove\n"));
 	miSpriteRemoveCursor (pScreen);
+    }
 
     (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc);
     SCREEN_EPILOGUE (pScreen, CopyWindow, miSpriteCopyWindow);
@@ -394,7 +413,10 @@
     SCREEN_EPILOGUE(pScreen, BlockHandler, miSpriteBlockHandler);
 
     if (!pPriv->isUp && pPriv->shouldBeUp)
+    {
+	SPRITE_DEBUG (("BlockHandler restore\n"));
 	miSpriteRestoreCursor (pScreen);
+    }
 }
 
 static void
@@ -692,11 +714,15 @@
 	}
 	else
 	{
+	    SPRITE_DEBUG (("SetCursor remove\n"));
 	    miSpriteRemoveCursor (pScreen);
 	}
     }
     if (!pScreenPriv->isUp && pScreenPriv->pCursor)
+    {
+	SPRITE_DEBUG (("SetCursor restore\n"));
 	miSpriteRestoreCursor (pScreen);
+    }
 }
 
 static void