From d3dc6c32a628a129447cf9ad1f9cd7d1f5d07ea0 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 1 Aug 2024 12:44:51 +0200 Subject: [PATCH] (!1654) Xnest: replace XFillRectangles() by xcb_poly_fill_rectangle() Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/GCOps.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c index 9b31e16f7..eee6a91cc 100644 --- a/hw/xnest/GCOps.c +++ b/hw/xnest/GCOps.c @@ -291,8 +291,13 @@ void xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles, xRectangle *pRectangles) { - XFillRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - (XRectangle *) pRectangles, nRectangles); + /* xRectangle and xcb_rectangle_t are defined in the same way, both matching + the protocol layout, so we can directly typecast them */ + xcb_poly_fill_rectangle(xnestUpstreamInfo.conn, + xnestDrawable(pDrawable), + xnest_upstream_gc(pGC), + nRectangles, + (xcb_rectangle_t*)pRectangles); } void @@ -376,8 +381,16 @@ xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst, XSetStipple(xnestDisplay, xnestGC(pGC), xnestPixmap(pBitmap)); XSetTSOrigin(xnestDisplay, xnestGC(pGC), x, y); XSetFillStyle(xnestDisplay, xnestGC(pGC), FillStippled); - XFillRectangle(xnestDisplay, xnestDrawable(pDst), - xnestGC(pGC), x, y, width, height); + + xcb_rectangle_t rect = { + .x = x, .y = y, .width = width, .height = height, + }; + xcb_poly_fill_rectangle(xnestUpstreamInfo.conn, + xnestDrawable(pDst), + xnest_upstream_gc(pGC), + 1, + &rect); + XSetFillStyle(xnestDisplay, xnestGC(pGC), FillSolid); } else