From 6731d7643a0e83fff9965e8df1748f3e76fcc9fc Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 8 Sep 2025 12:54:18 +0200 Subject: [PATCH] render: consolidate byte-swapping in ProcRenderFreePicture() No need for extra functions and call tables for the few trivial lines. Signed-off-by: Enrico Weigelt, metux IT consult --- render/render.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/render/render.c b/render/render.c index 5aaa6ef6eb..e3236ea00e 100644 --- a/render/render.c +++ b/render/render.c @@ -97,7 +97,6 @@ static int ProcRenderCreateConicalGradient(ClientPtr pClient); static int ProcRenderDispatch(ClientPtr pClient); -static int SProcRenderFreePicture(ClientPtr pClient); static int SProcRenderTrapezoids(ClientPtr pClient); static int SProcRenderTriangles(ClientPtr pClient); static int SProcRenderTriStrip(ClientPtr pClient); @@ -160,7 +159,7 @@ int (*SProcRenderVector[RenderNumberRequests]) (ClientPtr) = { ProcRenderCreatePicture, ProcRenderChangePicture, ProcRenderSetPictureClipRectangles, - SProcRenderFreePicture, + ProcRenderFreePicture, ProcRenderComposite, _not_implemented, /* SProcRenderScale */ SProcRenderTrapezoids, @@ -589,8 +588,6 @@ SingleRenderFreePicture(ClientPtr client) REQUEST(xRenderFreePictureReq); - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - VERIFY_PICTURE(pPicture, stuff->picture, client, DixDestroyAccess); FreeResource(stuff->picture, X11_RESTYPE_NONE); return Success; @@ -1968,15 +1965,6 @@ ProcRenderDispatch(ClientPtr client) return BadRequest; } -static int _X_COLD -SProcRenderFreePicture(ClientPtr client) -{ - REQUEST(xRenderFreePictureReq); - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - swapl(&stuff->picture); - return ProcRenderFreePicture(client); -} - static int _X_COLD SProcRenderTrapezoids(ClientPtr client) { @@ -2441,8 +2429,6 @@ PanoramiXRenderFreePicture(ClientPtr client) REQUEST(xRenderFreePictureReq); - REQUEST_SIZE_MATCH(xRenderFreePictureReq); - client->errorValue = stuff->picture; VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixDestroyAccess); @@ -3059,6 +3045,12 @@ ProcRenderSetPictureClipRectangles(ClientPtr client) static int ProcRenderFreePicture(ClientPtr client) { + REQUEST(xRenderFreePictureReq); + REQUEST_SIZE_MATCH(xRenderFreePictureReq); + + if (client->swapped) + swapl(&stuff->picture); + #ifdef XINERAMA return (usePanoramiX ? PanoramiXRenderFreePicture(client) : SingleRenderFreePicture(client));