[PATCH 2/2] damage: Remove "post-rendering" hooks

Adam Jackson ajax at redhat.com
Wed Aug 21 14:07:49 PDT 2013


This is a revert of 974db58f5b730c3770ee461665a02dd4334d1dea.  There are
no consumers of this API, we must not need it.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 miext/damage/damage.c    | 83 ++----------------------------------------------
 miext/damage/damage.h    | 18 -----------
 miext/damage/damagestr.h |  3 --
 3 files changed, 2 insertions(+), 102 deletions(-)

diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index a79a30e..3b9e81b 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -119,51 +119,6 @@ getDrawableDamageRef(DrawablePtr pDrawable)
     DamagePtr	*pPrev = (DamagePtr *) \
 	dixLookupPrivateAddr(&(pWindow)->devPrivates, damageWinPrivateKey)
 
-static void
-damageReportDamagePostRendering(DamagePtr pDamage, RegionPtr pOldDamage,
-                                RegionPtr pDamageRegion)
-{
-    BoxRec tmpBox;
-    RegionRec tmpRegion, newDamage;
-    Bool was_empty;
-
-    RegionUnion(&newDamage, pOldDamage, pDamageRegion);
-
-    switch (pDamage->damageLevel) {
-    case DamageReportRawRegion:
-        (*pDamage->damageReportPostRendering) (pDamage, pDamageRegion,
-                                               pDamage->closure);
-        break;
-    case DamageReportDeltaRegion:
-        RegionNull(&tmpRegion);
-        RegionSubtract(&tmpRegion, pDamageRegion, pOldDamage);
-        if (RegionNotEmpty(&tmpRegion)) {
-            (*pDamage->damageReportPostRendering) (pDamage, &tmpRegion,
-                                                   pDamage->closure);
-        }
-        RegionUninit(&tmpRegion);
-        break;
-    case DamageReportBoundingBox:
-        tmpBox = *RegionExtents(pOldDamage);
-        if (!BOX_SAME(&tmpBox, RegionExtents(&newDamage))) {
-            (*pDamage->damageReportPostRendering) (pDamage, &newDamage,
-                                                   pDamage->closure);
-        }
-        break;
-    case DamageReportNonEmpty:
-        was_empty = !RegionNotEmpty(pOldDamage);
-        if (was_empty && RegionNotEmpty(&newDamage)) {
-            (*pDamage->damageReportPostRendering) (pDamage, &newDamage,
-                                                   pDamage->closure);
-        }
-        break;
-    case DamageReportNone:
-        break;
-    }
-
-    RegionUninit(&newDamage);
-}
-
 #if DAMAGE_DEBUG_ENABLE
 static void
 _damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
@@ -299,14 +254,10 @@ damageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
             RegionTranslate(pDamageRegion, -draw_x, -draw_y);
 
         /* Store damage region if needed after submission. */
-        if (pDamage->reportAfter || pDamage->damageMarker)
+        if (pDamage->reportAfter)
             RegionUnion(&pDamage->pendingDamage,
                         &pDamage->pendingDamage, pDamageRegion);
 
-        /* Duplicate current damage if needed. */
-        if (pDamage->damageMarker)
-            RegionCopy(&pDamage->backupDamage, &pDamage->damage);
-
         /* Report damage now, if desired. */
         if (!pDamage->reportAfter) {
             if (pDamage->damageReport)
@@ -335,12 +286,6 @@ damageRegionProcessPending(DrawablePtr pDrawable)
     drawableDamage(pDrawable);
 
     for (; pDamage != NULL; pDamage = pDamage->pNext) {
-        /* submit damage marker whenever possible. */
-        if (pDamage->damageMarker)
-            (*pDamage->damageMarker) (pDrawable, pDamage,
-                                      &pDamage->backupDamage,
-                                      &pDamage->pendingDamage,
-                                      pDamage->closure);
         if (pDamage->reportAfter) {
             /* It's possible that there is only interest in postRendering reporting. */
             if (pDamage->damageReport)
@@ -350,10 +295,8 @@ damageRegionProcessPending(DrawablePtr pDrawable)
                             &pDamage->pendingDamage);
         }
 
-        if (pDamage->reportAfter || pDamage->damageMarker)
+        if (pDamage->reportAfter)
             RegionEmpty(&pDamage->pendingDamage);
-        if (pDamage->damageMarker)
-            RegionEmpty(&pDamage->backupDamage);
     }
 
 }
@@ -1763,9 +1706,7 @@ DamageCreate(DamageReportFunc damageReport,
     pDamage->reportAfter = FALSE;
 
     pDamage->damageReport = damageReport;
-    pDamage->damageReportPostRendering = NULL;
     pDamage->damageDestroy = damageDestroy;
-    pDamage->damageMarker = NULL;
     pDamage->pScreen = pScreen;
 
     (*pScrPriv->funcs.Create) (pDamage);
@@ -1933,17 +1874,6 @@ DamageRegionProcessPending(DrawablePtr pDrawable)
     damageRegionProcessPending(pDrawable);
 }
 
-/* If a damage marker is provided, then this function must be called after rendering is done. */
-/* Please do call back so any future enhancements can assume this function is called. */
-/* There are no strict timing requirements for calling this function, just as soon as (is cheaply) possible. */
-void
-DamageRegionRendered(DrawablePtr pDrawable, DamagePtr pDamage,
-                     RegionPtr pOldDamage, RegionPtr pRegion)
-{
-    if (pDamage->damageReportPostRendering)
-        damageReportDamagePostRendering(pDamage, pOldDamage, pRegion);
-}
-
 /* This call is very odd, i'm leaving it intact for API sake, but please don't use it. */
 void
 DamageDamageRegion(DrawablePtr pDrawable, RegionPtr pRegion)
@@ -1963,15 +1893,6 @@ DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter)
     pDamage->reportAfter = reportAfter;
 }
 
-void
-DamageSetPostRenderingFunctions(DamagePtr pDamage,
-                                DamageReportFunc damageReportPostRendering,
-                                DamageMarkerFunc damageMarker)
-{
-    pDamage->damageReportPostRendering = damageReportPostRendering;
-    pDamage->damageMarker = damageMarker;
-}
-
 DamageScreenFuncsPtr
 DamageGetScreenFuncs(ScreenPtr pScreen)
 {
diff --git a/miext/damage/damage.h b/miext/damage/damage.h
index c2c313a..cea1c90 100644
--- a/miext/damage/damage.h
+++ b/miext/damage/damage.h
@@ -41,12 +41,6 @@ typedef void (*DamageReportFunc) (DamagePtr pDamage, RegionPtr pRegion,
                                   void *closure);
 typedef void (*DamageDestroyFunc) (DamagePtr pDamage, void *closure);
 
-/* It's the responsibility of the driver to duplicate both regions. */
-/* At some point DamageRegionRendered() must be called. */
-typedef void (*DamageMarkerFunc) (DrawablePtr pDrawable, DamagePtr pDamage,
-                                  RegionPtr pOldDamage, RegionPtr pRegion,
-                                  void *closure);
-
 typedef void (*DamageScreenCreateFunc) (DamagePtr);
 typedef void (*DamageScreenRegisterFunc) (DrawablePtr, DamagePtr);
 typedef void (*DamageScreenUnregisterFunc) (DrawablePtr, DamagePtr);
@@ -105,12 +99,6 @@ extern _X_EXPORT void
 extern _X_EXPORT void
  DamageRegionProcessPending(DrawablePtr pDrawable);
 
-/* Call this some time after rendering is done, only relevant when a damageMarker is provided. */
-extern _X_EXPORT void
-
-DamageRegionRendered(DrawablePtr pDrawable, DamagePtr pDamage,
-                     RegionPtr pOldDamage, RegionPtr pRegion);
-
 /* Call this when you create a new Damage and you wish to send an initial damage message (to it). */
 extern _X_EXPORT void
  DamageReportDamage(DamagePtr pDamage, RegionPtr pDamageRegion);
@@ -122,12 +110,6 @@ extern _X_EXPORT void
 extern _X_EXPORT void
  DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter);
 
-extern _X_EXPORT void
-
-DamageSetPostRenderingFunctions(DamagePtr pDamage,
-                                DamageReportFunc damageReportPostRendering,
-                                DamageMarkerFunc damageMarker);
-
 extern _X_EXPORT DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr);
 
 #endif                          /* _DAMAGE_H_ */
diff --git a/miext/damage/damagestr.h b/miext/damage/damagestr.h
index 8918990..36753ee 100644
--- a/miext/damage/damagestr.h
+++ b/miext/damage/damagestr.h
@@ -44,13 +44,10 @@ typedef struct _damage {
     DrawablePtr pDrawable;
 
     DamageReportFunc damageReport;
-    DamageReportFunc damageReportPostRendering;
     DamageDestroyFunc damageDestroy;
-    DamageMarkerFunc damageMarker;
 
     Bool reportAfter;
     RegionRec pendingDamage;    /* will be flushed post submission at the latest */
-    RegionRec backupDamage;     /* for use with damageMarker */
     ScreenPtr pScreen;
     PrivateRec *devPrivates;
 } DamageRec;
-- 
1.8.3.1



More information about the xorg-devel mailing list