mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
render: consolidate byte-swapping in ProcRenderCreatePicture()
No need for extra functions and call tables for the few trivial lines. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
4fa442b6eb
commit
91902cdd86
@@ -97,7 +97,6 @@ static int ProcRenderCreateConicalGradient(ClientPtr pClient);
|
||||
|
||||
static int ProcRenderDispatch(ClientPtr pClient);
|
||||
|
||||
static int SProcRenderChangePicture(ClientPtr pClient);
|
||||
static int SProcRenderSetPictureClipRectangles(ClientPtr pClient);
|
||||
static int SProcRenderFreePicture(ClientPtr pClient);
|
||||
static int SProcRenderTrapezoids(ClientPtr pClient);
|
||||
@@ -163,7 +162,7 @@ int (*SProcRenderVector[RenderNumberRequests]) (ClientPtr) = {
|
||||
ProcRenderQueryPictIndexValues,
|
||||
_not_implemented, /* SProcRenderQueryDithers */
|
||||
ProcRenderCreatePicture,
|
||||
SProcRenderChangePicture,
|
||||
ProcRenderChangePicture,
|
||||
SProcRenderSetPictureClipRectangles,
|
||||
SProcRenderFreePicture,
|
||||
ProcRenderComposite,
|
||||
@@ -551,14 +550,12 @@ SingleRenderCreatePicture(ClientPtr client, xRenderCreatePictureReq *stuff)
|
||||
}
|
||||
|
||||
static int
|
||||
SingleRenderChangePicture(ClientPtr client)
|
||||
SingleRenderChangePicture(ClientPtr client, xRenderChangePictureReq *stuff)
|
||||
{
|
||||
PicturePtr pPicture;
|
||||
|
||||
REQUEST(xRenderChangePictureReq);
|
||||
int len;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
|
||||
VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess);
|
||||
|
||||
len = client->req_len - bytes_to_int32(sizeof(xRenderChangePictureReq));
|
||||
@@ -1942,17 +1939,6 @@ ProcRenderDispatch(ClientPtr client)
|
||||
return BadRequest;
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcRenderChangePicture(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRenderChangePictureReq);
|
||||
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
|
||||
swapl(&stuff->picture);
|
||||
swapl(&stuff->mask);
|
||||
SwapRestL(stuff);
|
||||
return ProcRenderChangePicture(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcRenderSetPictureClipRectangles(ClientPtr client)
|
||||
{
|
||||
@@ -2404,20 +2390,16 @@ PanoramiXRenderCreatePicture(ClientPtr client, xRenderCreatePictureReq *stuff)
|
||||
}
|
||||
|
||||
static int
|
||||
PanoramiXRenderChangePicture(ClientPtr client)
|
||||
PanoramiXRenderChangePicture(ClientPtr client, xRenderChangePictureReq *stuff)
|
||||
{
|
||||
PanoramiXRes *pict;
|
||||
int result = Success;
|
||||
|
||||
REQUEST(xRenderChangePictureReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
|
||||
|
||||
VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess);
|
||||
|
||||
XINERAMA_FOR_EACH_SCREEN_BACKWARD({
|
||||
stuff->picture = pict->info[walkScreenIdx].id;
|
||||
result = SingleRenderChangePicture(client);
|
||||
result = SingleRenderChangePicture(client, stuff);
|
||||
if (result != Success)
|
||||
break;
|
||||
});
|
||||
@@ -3073,11 +3055,20 @@ ProcRenderCreatePicture(ClientPtr client)
|
||||
static int
|
||||
ProcRenderChangePicture(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRenderChangePictureReq);
|
||||
REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&stuff->picture);
|
||||
swapl(&stuff->mask);
|
||||
SwapRestL(stuff);
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
return (usePanoramiX ? PanoramiXRenderChangePicture(client)
|
||||
: SingleRenderChangePicture(client));
|
||||
return (usePanoramiX ? PanoramiXRenderChangePicture(client, stuff)
|
||||
: SingleRenderChangePicture(client, stuff));
|
||||
#else
|
||||
return SingleRenderChangePicture(client);
|
||||
return SingleRenderChangePicture(client, stuff);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user