mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
render: consolidate byte-swapping in ProcRenderComposite()
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
52ea21c7c2
commit
8439b00fd1
@@ -100,7 +100,6 @@ static int SProcRenderCreatePicture(ClientPtr pClient);
|
||||
static int SProcRenderChangePicture(ClientPtr pClient);
|
||||
static int SProcRenderSetPictureClipRectangles(ClientPtr pClient);
|
||||
static int SProcRenderFreePicture(ClientPtr pClient);
|
||||
static int SProcRenderComposite(ClientPtr pClient);
|
||||
static int SProcRenderTrapezoids(ClientPtr pClient);
|
||||
static int SProcRenderTriangles(ClientPtr pClient);
|
||||
static int SProcRenderTriStrip(ClientPtr pClient);
|
||||
@@ -168,7 +167,7 @@ int (*SProcRenderVector[RenderNumberRequests]) (ClientPtr) = {
|
||||
SProcRenderChangePicture,
|
||||
SProcRenderSetPictureClipRectangles,
|
||||
SProcRenderFreePicture,
|
||||
SProcRenderComposite,
|
||||
ProcRenderComposite,
|
||||
_not_implemented, /* SProcRenderScale */
|
||||
SProcRenderTrapezoids,
|
||||
SProcRenderTriangles,
|
||||
@@ -625,13 +624,10 @@ PictOpValid(CARD8 op)
|
||||
}
|
||||
|
||||
static int
|
||||
SingleRenderComposite(ClientPtr client)
|
||||
SingleRenderComposite(ClientPtr client, xRenderCompositeReq *stuff)
|
||||
{
|
||||
PicturePtr pSrc, pMask, pDst;
|
||||
|
||||
REQUEST(xRenderCompositeReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRenderCompositeReq);
|
||||
if (!PictOpValid(stuff->op)) {
|
||||
client->errorValue = stuff->op;
|
||||
return BadValue;
|
||||
@@ -1992,25 +1988,6 @@ SProcRenderFreePicture(ClientPtr client)
|
||||
return ProcRenderFreePicture(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcRenderComposite(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRenderCompositeReq);
|
||||
REQUEST_SIZE_MATCH(xRenderCompositeReq);
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->mask);
|
||||
swapl(&stuff->dst);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
swaps(&stuff->xMask);
|
||||
swaps(&stuff->yMask);
|
||||
swaps(&stuff->xDst);
|
||||
swaps(&stuff->yDst);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
return ProcRenderComposite(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcRenderTrapezoids(ClientPtr client)
|
||||
{
|
||||
@@ -2565,16 +2542,12 @@ PanoramiXRenderFreePicture(ClientPtr client)
|
||||
}
|
||||
|
||||
static int
|
||||
PanoramiXRenderComposite(ClientPtr client)
|
||||
PanoramiXRenderComposite(ClientPtr client, xRenderCompositeReq *stuff)
|
||||
{
|
||||
PanoramiXRes *src, *msk, *dst;
|
||||
int result = Success;
|
||||
xRenderCompositeReq orig;
|
||||
|
||||
REQUEST(xRenderCompositeReq);
|
||||
|
||||
REQUEST_SIZE_MATCH(xRenderCompositeReq);
|
||||
|
||||
VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess);
|
||||
VERIFY_XIN_ALPHA(msk, stuff->mask, client, DixReadAccess);
|
||||
VERIFY_XIN_PICTURE(dst, stuff->dst, client, DixWriteAccess);
|
||||
@@ -2599,7 +2572,7 @@ PanoramiXRenderComposite(ClientPtr client)
|
||||
stuff->yMask = orig.yMask - walkScreen->y;
|
||||
}
|
||||
}
|
||||
result = SingleRenderComposite(client);
|
||||
result = SingleRenderComposite(client, stuff);
|
||||
if (result != Success)
|
||||
break;
|
||||
});
|
||||
@@ -3148,11 +3121,28 @@ ProcRenderFreePicture(ClientPtr client)
|
||||
static int
|
||||
ProcRenderComposite(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRenderCompositeReq);
|
||||
REQUEST_SIZE_MATCH(xRenderCompositeReq);
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->mask);
|
||||
swapl(&stuff->dst);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
swaps(&stuff->xMask);
|
||||
swaps(&stuff->yMask);
|
||||
swaps(&stuff->xDst);
|
||||
swaps(&stuff->yDst);
|
||||
swaps(&stuff->width);
|
||||
swaps(&stuff->height);
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
return (usePanoramiX ? PanoramiXRenderComposite(client)
|
||||
: SingleRenderComposite(client));
|
||||
return (usePanoramiX ? PanoramiXRenderComposite(client, stuff)
|
||||
: SingleRenderComposite(client, stuff));
|
||||
#else
|
||||
return SingleRenderComposite(client);
|
||||
return SingleRenderComposite(client, stuff);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user