Xnest: GC: set stipple filling via xcb_change_gc

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-05 16:27:38 +02:00
parent 284eff8e96
commit c263e6220b

View File

@ -13,11 +13,16 @@ is" without express or implied warranty.
*/ */
#include <dix-config.h> #include <dix-config.h>
#include <stdint.h>
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xdefs.h> #include <X11/Xdefs.h>
#include <X11/Xproto.h> #include <X11/Xproto.h>
#include <X11/fonts/fontstruct.h> #include <X11/fonts/fontstruct.h>
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include "regionstr.h" #include "regionstr.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "scrnintstr.h" #include "scrnintstr.h"
@ -417,9 +422,17 @@ xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
{ {
/* only works for solid bitmaps */ /* only works for solid bitmaps */
if (pGC->fillStyle == FillSolid) { if (pGC->fillStyle == FillSolid) {
XSetStipple(xnestDisplay, xnestGC(pGC), xnestPixmap(pBitmap)); xcb_params_gc_t params = {
XSetTSOrigin(xnestDisplay, xnestGC(pGC), x, y); .fill_style = XCB_FILL_STYLE_STIPPLED,
XSetFillStyle(xnestDisplay, xnestGC(pGC), FillStippled); .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,
&params);
xcb_rectangle_t rect = { xcb_rectangle_t rect = {
.x = x, .y = y, .width = width, .height = height, .x = x, .y = y, .width = width, .height = height,
@ -430,7 +443,10 @@ xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
1, 1,
&rect); &rect);
XSetFillStyle(xnestDisplay, xnestGC(pGC), FillSolid); xcb_aux_change_gc(xnestUpstreamInfo.conn,
xnest_upstream_gc(pGC),
XCB_GC_FILL_STYLE,
&params);
} }
else else
ErrorF("xnest warning: function xnestPushPixels not implemented\n"); ErrorF("xnest warning: function xnestPushPixels not implemented\n");