[xserver-commit] xserver/miext/damage damage.c,1.1.2.2,1.1.2.3 damage.h,1.1.2.1,1.1.2.2 damagestr.h,1.1.2.1,1.1.2.2

Keith Packard xserver-commit@pdx.freedesktop.org
Thu, 23 Oct 2003 23:35:26 -0700


Committed by: keithp

Update of /cvs/xserver/xserver/miext/damage
In directory pdx:/tmp/cvs-serv25100/miext/damage

Modified Files:
      Tag: xfixes_2_branch
	damage.c damage.h damagestr.h 
Log Message:
	* Makefile.am:
	* configure.ac:
	* damageext/Makefile.am:
	* damageext/damageext.c: (DamageExtNotify), (DamageExtReport),
	(DamageExtDestroy), (ProcDamageQueryVersion), (ProcDamageCreate),
	(ProcDamageDestroy), (ProcDamageSubtract), (XDamageNumberRequests),
	(ProcDamageDispatch), (SProcDamageQueryVersion),
	(SProcDamageCreate), (SProcDamageDestroy), (SProcDamageSubtract),
	(SProcDamageDispatch), (DamageClientCallback), (DamageResetProc),
	(FreeDamageExt), (FreeDamageExtWin), (SDamageNotifyEvent),
	(DamageExtensionInit):
	* damageext/damageext.h:
	* damageext/damageextint.h:
	* hw/kdrive/fbdev/Makefile.am:
	* hw/kdrive/linux/Makefile.am:
	* hw/kdrive/mach64/Makefile.am:
	* hw/kdrive/mga/Makefile.am:
	* hw/kdrive/nvidia/Makefile.am:
	* hw/kdrive/r128/Makefile.am:
	* hw/kdrive/smi/Makefile.am:
	* hw/kdrive/src/Makefile.am:
	* hw/kdrive/vesa/Makefile.am:
	* hw/xnest/Makefile.am:
	* mi/Makefile.am:
	* mi/miinitext.c:
	* mi/misprite.c:
	* miext/damage/damage.c: (damageDamageRegion), (DamageCreate),
	(DamageDestroy):
	* miext/damage/damage.h:
	* miext/damage/damagestr.h:
	* miext/shadow/shadow.c: (shadowSetup):
	* xfixes/region.c:
	* xfixes/xfixes.h:
	* xfixes/xfixesint.h:
	Ok, so this change is way bigger than it needed to be, but I
	couldn't stand it anymore.  The "real" change here is the
	addition of the damage extension server side pieces and a
	minor change of the miext/damage interface to add a callback
	on damage destroy.  All of the configuration changes are to
	add macros for various sets of libraries so that we don't have to
	keep editing every Makefile.am whenever we add another extension
	to the library.  The xfixes changes expose VERIFY_REGION so
	that damageext can use it.


Index: damage.c
===================================================================
RCS file: /cvs/xserver/xserver/miext/damage/Attic/damage.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -d -r1.1.2.2 -r1.1.2.3
--- damage.c	22 Oct 2003 21:23:45 -0000	1.1.2.2
+++ damage.c	24 Oct 2003 06:35:24 -0000	1.1.2.3
@@ -156,7 +156,7 @@
 	    was_empty = !REGION_NOTEMPTY(pScreen, &pDamage->damage);
 	    REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage,
 			 pRegion);
-	    if (was_empty && !REGION_NOTEMPTY(pScreen, &pDamage->damage))
+	    if (was_empty && REGION_NOTEMPTY(pScreen, &pDamage->damage))
 		(*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure);
 	    break;
 	case DamageReportNone:
@@ -1537,6 +1537,7 @@
 
 DamagePtr
 DamageCreate (DamageReportFunc  damageReport,
+	      DamageDestroyFunc	damageDestroy,
 	      DamageReportLevel	damageLevel,
 	      Bool		isInternal,
 	      void		*closure)
@@ -1549,6 +1550,7 @@
     REGION_INIT(pScreen, &pDamage->damage, NullBox, 0);
     pDamage->pNext = 0;
     pDamage->damageReport = damageReport;
+    pDamage->damageDestroy = damageDestroy;
     pDamage->damageLevel = damageLevel;
     pDamage->isInternal = isInternal;
     pDamage->closure = closure;
@@ -1580,6 +1582,8 @@
 void
 DamageDestroy (DamagePtr    pDamage)
 {
+    if (pDamage->damageDestroy)
+	(*pDamage->damageDestroy) (pDamage, pDamage->closure);
     REGION_UNINIT (pScreen, &pDamage->damage);
     xfree (pDamage);
 }

Index: damage.h
===================================================================
RCS file: /cvs/xserver/xserver/miext/damage/Attic/damage.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- damage.h	22 Oct 2003 06:01:44 -0000	1.1.2.1
+++ damage.h	24 Oct 2003 06:35:24 -0000	1.1.2.2
@@ -36,12 +36,14 @@
 } DamageReportLevel;
 
 typedef void (*DamageReportFunc) (DamagePtr pDamage, RegionPtr pRegion, void *closure);
+typedef void (*DamageDestroyFunc) (DamagePtr pDamage, void *closure);
 
 Bool
 DamageSetup (ScreenPtr pScreen);
     
 DamagePtr
 DamageCreate (DamageReportFunc  damageReport,
+	      DamageDestroyFunc	damageDestroy,
 	      DamageReportLevel damageLevel,
 	      Bool		isInternal,
 	      void		*closure);

Index: damagestr.h
===================================================================
RCS file: /cvs/xserver/xserver/miext/damage/Attic/damagestr.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- damagestr.h	22 Oct 2003 06:01:45 -0000	1.1.2.1
+++ damagestr.h	24 Oct 2003 06:35:24 -0000	1.1.2.2
@@ -37,6 +37,7 @@
     void		*closure;
     
     DamageReportFunc	damageReport;
+    DamageDestroyFunc	damageDestroy;
 } DamageRec;
 
 typedef struct _damageScrPriv {