[PATCH 4/4] miext/damage: Only wrap into the GC ops chain if there's a listener

Adam Jackson ajax at redhat.com
Tue Dec 13 14:31:53 PST 2011


Before:
40000000 trep @   0.0009 msec (1148346.9/sec): PutImage 10x10 square
60000000 trep @   0.0005 msec (2091666.1/sec): ShmPutImage 10x10 square

After:
40000000 trep @   0.0008 msec (1191807.5/sec): PutImage 10x10 square
60000000 trep @   0.0005 msec (2180983.0/sec): ShmPutImage 10x10 square

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 miext/damage/damage.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index d791211..dd4026b 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -437,9 +437,13 @@ damageValidateGC(GCPtr         pGC,
 		 unsigned long changes,
 		 DrawablePtr   pDrawable)
 {
+    drawableDamage(pDrawable);
     DAMAGE_GC_FUNC_PROLOGUE (pGC);
     (*pGC->funcs->ValidateGC)(pGC, changes, pDrawable);
-    pGCPriv->ops = pGC->ops;  /* just so it's not NULL */
+    if (pDamage)
+	pGCPriv->ops = pGC->ops;  /* just so it's not NULL */
+    else
+	pGCPriv->ops = NULL;
     DAMAGE_GC_FUNC_EPILOGUE (pGC);
 }
 
-- 
1.7.7



More information about the xorg-devel mailing list