[PATCH libXdamage] Add XDamageSubtractAndTrigger operation

James Jones jajones at nvidia.com
Tue Sep 21 16:32:04 PDT 2010


XDamageSubtractAndTrigger behaves exactly like
XDamageSubtract except it receives an optional
fence sync object.  If the value of this object
is not None, it is triggered by X once all the
rendering associated with the damage regions
being subtracted has completed.

Signed-off-by: James Jones <jajones at nvidia.com>
Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
---
 include/X11/extensions/Xdamage.h |    7 +++++++
 src/Xdamage.c                    |   21 +++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/include/X11/extensions/Xdamage.h b/include/X11/extensions/Xdamage.h
index 5ecf035..181601d 100644
--- a/include/X11/extensions/Xdamage.h
+++ b/include/X11/extensions/Xdamage.h
@@ -25,9 +25,11 @@
 
 #include <X11/extensions/damagewire.h>
 #include <X11/extensions/Xfixes.h>
+#include <X11/extensions/syncconst.h>
 #include <X11/Xfuncproto.h>
 
 #define XDAMAGE_1_1_INTERFACE
+#define XDAMAGE_1_2_INTERFACE
 
 typedef XID Damage;
 
@@ -68,6 +70,11 @@ XDamageSubtract (Display *dpy, Damage damage,
 void
 XDamageAdd (Display *dpy, Drawable drawable, XserverRegion region);
 
+void
+XDamageSubtractAndTrigger (Display *dpy, Damage damage,
+			   XserverRegion repair, XserverRegion parts,
+			   XSyncFence finishedFence);
+
 _XFUNCPROTOEND
 
 #endif /* _XDAMAGE_H_ */
diff --git a/src/Xdamage.c b/src/Xdamage.c
index 3a368d2..636ab48 100644
--- a/src/Xdamage.c
+++ b/src/Xdamage.c
@@ -383,3 +383,24 @@ XDamageAdd (Display *dpy, Drawable drawable, XserverRegion region)
     UnlockDisplay (dpy);
     SyncHandle ();
 }
+
+void
+XDamageSubtractAndTrigger (Display *dpy, Damage damage,
+			   XserverRegion repair, XserverRegion parts,
+			   XSyncFence finishedFence)
+{
+    XDamageExtDisplayInfo		*info = XDamageFindDisplay (dpy);
+    xDamageSubtractAndTriggerReq	*req;
+
+    XDamageSimpleCheckExtension (dpy, info);
+    LockDisplay (dpy);
+    GetReq (DamageSubtractAndTrigger, req);
+    req->reqType = info->codes->major_opcode;
+    req->damageReqType = X_DamageSubtractAndTrigger;
+    req->damage = damage;
+    req->repair = repair;
+    req->parts = parts;
+    req->finishedFence = finishedFence;
+    UnlockDisplay (dpy);
+    SyncHandle ();
+}
-- 
1.7.1



More information about the xorg-devel mailing list