From 465e628bec7916c2b5817b7dc787bad0ddbfc68a Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 19 Sep 2024 14:45:39 +0200 Subject: [PATCH] 1 --- hw/xnest/render.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/hw/xnest/render.c b/hw/xnest/render.c index a2a7d88b7..0040fc91a 100644 --- a/hw/xnest/render.c +++ b/hw/xnest/render.c @@ -11,17 +11,35 @@ #include "xnest-xcb.h" -struct xnest_picture_priv { +struct xnest_picture_privrec { xcb_render_picture_t upstream_xid; }; DevPrivateKeyRec xnestPicturePrivateKey; +static inline struct xnest_render_picture_privrec * + xnest_render_picture_get_priv(PicturePtr pPict) +{ + void *p = dixLookupPrivate(&pPict->devPrivates, &xnestPicturePrivateKey); + if (p) + fprintf(stderr, "PRIV OK\n"); + else + fprintf(stderr, "PRIV MISSING\n"); + return p; +} + static void xnest_render_composite( uint8_t op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height) { + struct xnest_render_picture_privrec *pSrcPriv = + xnest_render_picture_get_priv(pSrc); + struct xnest_render_picture_privrec *pMaskPriv = + xnest_render_picture_get_priv(pMask); + struct xnest_render_picture_privrec *pDstkPriv = + xnest_render_picture_get_priv(pDst); + fprintf(stderr, "xnest_render_composite\n"); } @@ -29,12 +47,18 @@ static void xnest_render_add_traps( PicturePtr pPicture, int16_t xOff, int16_t yOff, int ntrap, xTrap *traps) { + struct xnest_render_picture_privrec *pPicture = + xnest_render_picture_get_priv(pPicture); + fprintf(stderr, "xnest_render_add_traps\n"); } static void xnest_render_rasterize_trapezoid( PicturePtr alpha, xTrapezoid *trap, int x_off, int y_off) { + struct xnest_render_picture_privrec *pPicture = + xnest_render_picture_get_priv(pPicture); + fprintf(stderr, "xnest_render_rasterize_trapezoid\n"); } @@ -82,7 +106,7 @@ Bool xnest_picture_init(ScreenPtr pScreen) if (!miPictureInit(pScreen, 0, 0)) return FALSE; - if (!dixRegisterPrivateKey(&xnestPicturePrivateKey, PRIVATE_PICTURE, sizeof(struct xnest_picture_priv))) { + if (!dixRegisterPrivateKey(&xnestPicturePrivateKey, PRIVATE_PICTURE, sizeof(struct xnest_picture_privrec))) { fprintf(stderr, "failed to allocate PRIVATE_PICTURE\n"); return FALSE; }