From c263e6220bb77fc06c85986456718e3b5750dd57 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 5 Aug 2024 16:27:38 +0200 Subject: [PATCH] Xnest: GC: set stipple filling via xcb_change_gc Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/GCOps.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c index 055d8ba53..50066fce6 100644 --- a/hw/xnest/GCOps.c +++ b/hw/xnest/GCOps.c @@ -13,11 +13,16 @@ is" without express or implied warranty. */ #include +#include + #include #include #include #include +#include +#include + #include "regionstr.h" #include "gcstruct.h" #include "scrnintstr.h" @@ -417,9 +422,17 @@ xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst, { /* only works for solid bitmaps */ if (pGC->fillStyle == FillSolid) { - XSetStipple(xnestDisplay, xnestGC(pGC), xnestPixmap(pBitmap)); - XSetTSOrigin(xnestDisplay, xnestGC(pGC), x, y); - XSetFillStyle(xnestDisplay, xnestGC(pGC), FillStippled); + xcb_params_gc_t params = { + .fill_style = XCB_FILL_STYLE_STIPPLED, + .tile_stipple_origin_x = x, + .tile_stipple_origin_y = y, + .stipple = xnestPixmap(pBitmap), + }; + xcb_aux_change_gc(xnestUpstreamInfo.conn, + xnest_upstream_gc(pGC), + XCB_GC_FILL_STYLE | XCB_GC_TILE_STIPPLE_ORIGIN_X | + XCB_GC_TILE_STIPPLE_ORIGIN_Y | XCB_GC_STIPPLE, + ¶ms); xcb_rectangle_t rect = { .x = x, .y = y, .width = width, .height = height, @@ -430,7 +443,10 @@ xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst, 1, &rect); - XSetFillStyle(xnestDisplay, xnestGC(pGC), FillSolid); + xcb_aux_change_gc(xnestUpstreamInfo.conn, + xnest_upstream_gc(pGC), + XCB_GC_FILL_STYLE, + ¶ms); } else ErrorF("xnest warning: function xnestPushPixels not implemented\n");