[PATCH libXdamage (rev3)] Add XDamageSubtractAndTrigger operation
James Jones
jajones at nvidia.com
Thu Dec 2 15:43:52 PST 2010
Changes since last version of patch:
-Require damageproto 1.3.0, not 1.2.99
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.
Bump version number to match protocol version,
and require damageproto 1.3.0
Signed-off-by: James Jones <jajones at nvidia.com>
Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
---
configure.ac | 4 ++--
include/X11/extensions/Xdamage.h | 7 +++++++
src/Makefile.am | 2 +-
src/Xdamage.c | 21 +++++++++++++++++++++
4 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9382ec5..cc645bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ dnl digit in the version number to track changes which don't affect the
dnl protocol, so Xdamage version l.n.m corresponds to protocol version l.n
dnl
AC_INIT(libXdamage,
- 1.1.3,
+ 1.2.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
libXdamage)
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -53,7 +53,7 @@ AC_PROG_LIBTOOL
DAMAGEEXT_VERSION=[`echo $VERSION | sed 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`]
AC_SUBST(DAMAGEEXT_VERSION)
-PKG_CHECK_MODULES(XDAMAGE, [damageproto >= $DAMAGEEXT_VERSION] xfixes fixesproto xextproto x11)
+PKG_CHECK_MODULES(XDAMAGE, [damageproto >= 1.3.0] xfixes fixesproto [xextproto >= 7.1.99] x11)
AC_SUBST(XDAMAGE_CFLAGS)
AC_OUTPUT([Makefile
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/Makefile.am b/src/Makefile.am
index 787fc04..f0564f4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,7 +9,7 @@ AM_CFLAGS = $(CWARNFLAGS) $(XDAMAGE_CFLAGS)
INCLUDES = -I$(top_srcdir)/include/X11/extensions
-libXdamage_la_LDFLAGS = -version-number 1:1:0 -no-undefined
+libXdamage_la_LDFLAGS = -version-number 1:2:0 -no-undefined
libXdamageincludedir = $(includedir)/X11/extensions
libXdamageinclude_HEADERS = $(top_srcdir)/include/X11/extensions/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