From dbf6a04f8fe1d08cc625f5d3b772dcb584d15643 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 31 Jul 2024 15:09:48 +0200 Subject: [PATCH] Xnest: use xcb_put_image() for PutImage requests Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xnest/GCOps.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c index 42db50c10..a0b04d118 100644 --- a/hw/xnest/GCOps.c +++ b/hw/xnest/GCOps.c @@ -27,6 +27,7 @@ is" without express or implied warranty. #include "servermd.h" #include "Xnest.h" +#include "xnest-xcb.h" #include "Display.h" #include "Screen.h" @@ -78,19 +79,19 @@ void xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pImage) { - XImage *ximage; - - ximage = XCreateImage(xnestDisplay, xnestDefaultVisual(pDrawable->pScreen), - depth, format, leftPad, (char *) pImage, - w, h, BitmapPad(xnestDisplay), - (format == ZPixmap) ? - PixmapBytePad(w, depth) : BitmapBytePad(w + leftPad)); - - if (ximage) { - XPutImage(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - ximage, 0, 0, x, y, w, h); - XFree(ximage); - } + xcb_put_image(xnestUpstreamInfo.conn, + format, + xnestDrawable(pDrawable), + xnest_upstream_gc(pGC), + w, + h, + x, + y, + leftPad, + depth, + (format == XCB_IMAGE_FORMAT_Z_PIXMAP ? PixmapBytePad(w, depth) + : BitmapBytePad(w + leftPad)) * h, + (uint8_t*)pImage); } static int