Add support for the DamagePost (XDamage 1.1) request.
This makes damageproto >= 1.1 a requirement to build.
This commit is contained in:
parent
dfb2c10413
commit
0b73a7eb17
|
@ -603,7 +603,7 @@ XEXT_LIB='$(top_builddir)/Xext/libXext.la'
|
||||||
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
|
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
|
||||||
|
|
||||||
dnl Core modules for most extensions, et al.
|
dnl Core modules for most extensions, et al.
|
||||||
REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] damageproto xcmiscproto xextproto xproto xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4] [kbproto >= 1.0.3]"
|
REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto xproto xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4] [kbproto >= 1.0.3]"
|
||||||
REQUIRED_LIBS="xfont xau fontenc"
|
REQUIRED_LIBS="xfont xau fontenc"
|
||||||
|
|
||||||
if test "x$DBUS" = xauto; then
|
if test "x$DBUS" = xauto; then
|
||||||
|
|
|
@ -279,10 +279,35 @@ ProcDamageSubtract (ClientPtr client)
|
||||||
return (client->noClientException);
|
return (client->noClientException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ProcDamagePost (ClientPtr client)
|
||||||
|
{
|
||||||
|
REQUEST(xDamagePostReq);
|
||||||
|
DrawablePtr pDrawable;
|
||||||
|
RegionPtr pRegion;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xDamagePostReq);
|
||||||
|
VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
|
||||||
|
rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
|
||||||
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
/* The region is relative to the drawable origin, so translate it out to
|
||||||
|
* screen coordinates like damage expects.
|
||||||
|
*/
|
||||||
|
REGION_TRANSLATE(pScreen, pRegion, pDrawable->x, pDrawable->y);
|
||||||
|
DamageDamageRegion(pDrawable, pRegion);
|
||||||
|
REGION_TRANSLATE(pScreen, pRegion, -pDrawable->x, -pDrawable->y);
|
||||||
|
|
||||||
|
return (client->noClientException);
|
||||||
|
}
|
||||||
|
|
||||||
/* Major version controls available requests */
|
/* Major version controls available requests */
|
||||||
static const int version_requests[] = {
|
static const int version_requests[] = {
|
||||||
X_DamageQueryVersion, /* before client sends QueryVersion */
|
X_DamageQueryVersion, /* before client sends QueryVersion */
|
||||||
X_DamageSubtract, /* Version 1 */
|
X_DamagePost, /* Version 1 */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
|
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
|
||||||
|
@ -293,6 +318,8 @@ int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
|
||||||
ProcDamageCreate,
|
ProcDamageCreate,
|
||||||
ProcDamageDestroy,
|
ProcDamageDestroy,
|
||||||
ProcDamageSubtract,
|
ProcDamageSubtract,
|
||||||
|
/*************** Version 1.1 ****************/
|
||||||
|
ProcDamagePost,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -361,12 +388,27 @@ SProcDamageSubtract (ClientPtr client)
|
||||||
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
SProcDamagePost (ClientPtr client)
|
||||||
|
{
|
||||||
|
register int n;
|
||||||
|
REQUEST(xDamagePostReq);
|
||||||
|
|
||||||
|
swaps (&stuff->length, n);
|
||||||
|
REQUEST_SIZE_MATCH(xDamageSubtractReq);
|
||||||
|
swapl (&stuff->drawable, n);
|
||||||
|
swapl (&stuff->region, n);
|
||||||
|
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
||||||
|
}
|
||||||
|
|
||||||
int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
|
int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
|
||||||
/*************** Version 1 ******************/
|
/*************** Version 1 ******************/
|
||||||
SProcDamageQueryVersion,
|
SProcDamageQueryVersion,
|
||||||
SProcDamageCreate,
|
SProcDamageCreate,
|
||||||
SProcDamageDestroy,
|
SProcDamageDestroy,
|
||||||
SProcDamageSubtract,
|
SProcDamageSubtract,
|
||||||
|
/*************** Version 1.1 ****************/
|
||||||
|
SProcDamagePost,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Reference in New Issue