[PATCH] damage: use DamageInitialReport for the initial borderClip damage report
Erkki Seppälä
erkki.seppala at vincit.fi
Mon Apr 11 07:45:00 PDT 2011
Instead of using the "proper" DamageDamageRegion for reporting the
first (virtual) damage in ProcDamageCreate that covers the borderClip
of the drawable window, use a new function DamageInitialReport that
uses damageReportDamage to do the work. This avoids sending all other
damage listeners a full window update when a new damage object is
created.
Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
---
damageext/damageext.c | 2 +-
miext/damage/damage.c | 12 ++++++++++++
miext/damage/damage.h | 5 +++++
3 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/damageext/damageext.c b/damageext/damageext.c
index cfef069..12e4bb1 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -223,7 +223,7 @@ ProcDamageCreate (ClientPtr client)
if (pDrawable->type == DRAWABLE_WINDOW)
{
pRegion = &((WindowPtr) pDrawable)->borderClip;
- DamageDamageRegion(pDrawable, pRegion);
+ DamageInitialDamage(pDrawable, pRegion);
}
return Success;
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index a3de044..a698d14 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -2115,6 +2115,18 @@ DamageRegionRendered (DrawablePtr pDrawable, DamagePtr pDamage, RegionPtr pOldDa
damageReportDamagePostRendering (pDamage, pOldDamage, pRegion);
}
+void
+DamageInitialDamage (DrawablePtr pDrawable,
+ const RegionPtr pRegion)
+{
+ ScreenPtr pScreen = pDrawable->pScreen;
+ damageScrPriv(pScreen);
+ drawableDamage(pDrawable);
+
+ damageReportDamage(pDamage, pRegion);
+}
+
+
/* This call is very odd, i'm leaving it intact for API sake, but please don't use it. */
void
DamageDamageRegion (DrawablePtr pDrawable,
diff --git a/miext/damage/damage.h b/miext/damage/damage.h
index 067016f..a3125ea 100644
--- a/miext/damage/damage.h
+++ b/miext/damage/damage.h
@@ -110,6 +110,11 @@ DamageRegionProcessPending (DrawablePtr pDrawable);
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
+DamageInitialDamage (DrawablePtr pDrawable,
+ const RegionPtr pRegion);
+
/* Avoid using this call, it only exists for API compatibility. */
extern _X_EXPORT void
DamageDamageRegion (DrawablePtr pDrawable,
--
1.7.0.4
More information about the xorg-devel
mailing list