mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
render: consolidate byte-swapping in ProcRenderTriStrip()
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
81a8619bda
commit
92af1b26ff
@@ -98,7 +98,6 @@ static int ProcRenderCreateConicalGradient(ClientPtr pClient);
|
||||
|
||||
static int ProcRenderDispatch(ClientPtr pClient);
|
||||
|
||||
static int SProcRenderTriStrip(ClientPtr pClient);
|
||||
static int SProcRenderTriFan(ClientPtr pClient);
|
||||
static int SProcRenderCompositeGlyphs(ClientPtr pClient);
|
||||
static int SProcRenderFillRectangles(ClientPtr pClient);
|
||||
@@ -163,7 +162,7 @@ int (*SProcRenderVector[RenderNumberRequests]) (ClientPtr) = {
|
||||
_not_implemented, /* SProcRenderScale */
|
||||
ProcRenderTrapezoids,
|
||||
ProcRenderTriangles,
|
||||
SProcRenderTriStrip,
|
||||
ProcRenderTriStrip,
|
||||
SProcRenderTriFan,
|
||||
_not_implemented, /* SProcRenderColorTrapezoids */
|
||||
_not_implemented, /* SProcRenderColorTriangles */
|
||||
@@ -716,15 +715,12 @@ SingleRenderTriangles(ClientPtr client, xRenderTrianglesReq *stuff)
|
||||
}
|
||||
|
||||
static int
|
||||
SingleRenderTriStrip(ClientPtr client)
|
||||
SingleRenderTriStrip(ClientPtr client, xRenderTriStripReq *stuff)
|
||||
{
|
||||
int rc, npoints;
|
||||
PicturePtr pSrc, pDst;
|
||||
PictFormatPtr pFormat;
|
||||
|
||||
REQUEST(xRenderTrianglesReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
|
||||
if (!PictOpValid(stuff->op)) {
|
||||
client->errorValue = stuff->op;
|
||||
return BadValue;
|
||||
@@ -1957,21 +1953,6 @@ ProcRenderDispatch(ClientPtr client)
|
||||
return BadRequest;
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcRenderTriStrip(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRenderTriStripReq);
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderTriStripReq);
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->dst);
|
||||
swapl(&stuff->maskFormat);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
SwapRestL(stuff);
|
||||
return ProcRenderTriStrip(client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
SProcRenderTriFan(ClientPtr client)
|
||||
{
|
||||
@@ -2647,17 +2628,14 @@ PanoramiXRenderTriangles(ClientPtr client, xRenderTrianglesReq *stuff)
|
||||
}
|
||||
|
||||
static int
|
||||
PanoramiXRenderTriStrip(ClientPtr client)
|
||||
PanoramiXRenderTriStrip(ClientPtr client, xRenderTriStripReq *stuff)
|
||||
{
|
||||
PanoramiXRes *src, *dst;
|
||||
int result = Success;
|
||||
|
||||
REQUEST(xRenderTriStripReq);
|
||||
char *extra;
|
||||
int extra_len;
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xRenderTriStripReq);
|
||||
|
||||
VERIFY_XIN_PICTURE(src, stuff->src, client, DixReadAccess);
|
||||
VERIFY_XIN_PICTURE(dst, stuff->dst, client, DixWriteAccess);
|
||||
|
||||
@@ -2687,7 +2665,7 @@ PanoramiXRenderTriStrip(ClientPtr client)
|
||||
|
||||
stuff->src = src->info[walkScreenIdx].id;
|
||||
stuff->dst = dst->info[walkScreenIdx].id;
|
||||
result = SingleRenderTriStrip(client);
|
||||
result = SingleRenderTriStrip(client, stuff);
|
||||
|
||||
if (result != Success)
|
||||
break;
|
||||
@@ -3092,11 +3070,23 @@ ProcRenderTriangles(ClientPtr client)
|
||||
static int
|
||||
ProcRenderTriStrip(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRenderTriStripReq);
|
||||
REQUEST_AT_LEAST_SIZE(xRenderTriStripReq);
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&stuff->src);
|
||||
swapl(&stuff->dst);
|
||||
swapl(&stuff->maskFormat);
|
||||
swaps(&stuff->xSrc);
|
||||
swaps(&stuff->ySrc);
|
||||
SwapRestL(stuff);
|
||||
}
|
||||
|
||||
#ifdef XINERAMA
|
||||
return (usePanoramiX ? PanoramiXRenderTriStrip(client)
|
||||
: SingleRenderTriStrip(client));
|
||||
return (usePanoramiX ? PanoramiXRenderTriStrip(client, stuff)
|
||||
: SingleRenderTriStrip(client, stuff));
|
||||
#else
|
||||
return SingleRenderTriStrip(client);
|
||||
return SingleRenderTriStrip(client, stuff));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user