PKG_CHECK_MODULES([X11], [x11], [:], [USE_X11="no"])
PKG_CHECK_MODULES([XEXT], [xext], [:], [USE_X11="no"])
PKG_CHECK_MODULES([XFIXES], [xfixes], [:], [USE_X11="no"])
+ PKG_CHECK_MODULES([XDAMAGE], [xdamage], [:], [USE_X11="no"])
if test "$USE_X11" = "yes"; then
AC_DEFINE([HAVE_VA_X11], [1], [Defined to 1 if VA/X11 API is built])
fi
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
+#include <X11/extensions/Xfixes.h>
+#include <X11/extensions/Xdamage.h>
static int va_DisplayContextIsValid (
VADisplayContextP pDisplayContext
unsigned int flags /* de-interlacing flags */
);
-
+static void va_report_damage(VADriverContextP ctx, Drawable draw, int x, int y, int width, int height)
+{
+ XRectangle xrect;
+ XserverRegion region;
+
+ xrect.x = x;
+ xrect.y = y;
+ xrect.width = width;
+ xrect.height = height;
+
+ region = XFixesCreateRegion(ctx->native_dpy, &xrect, 1);
+ XDamageAdd(ctx->native_dpy, draw, region);
+ XFixesDestroyRegion(ctx->native_dpy, region);
+ XFlush(ctx->native_dpy);
+}
VAStatus vaPutSurface (
VADisplay dpy,
VASurfaceID surface,
)
{
VADriverContextP ctx;
+ VAStatus status;
+ XRectangle rect;
if (fool_postp)
return VA_STATUS_SUCCESS;
destx, desty, destw, desth,
cliprects, number_cliprects, flags );
- return ctx->vtable->vaPutSurface( ctx, surface, (void *)draw, srcx, srcy, srcw, srch,
+ status = ctx->vtable->vaPutSurface( ctx, surface, (void *)draw, srcx, srcy, srcw, srch,
destx, desty, destw, desth,
cliprects, number_cliprects, flags );
+
+ va_report_damage(ctx, draw, destx, desty, destw, desth);
+
+ return status;
}