diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2019-07-27 07:57:27 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2019-07-27 07:57:27 +0000 |
commit | d4a0bed4b91da9de86c311c7fef9a8aa9a6f500c (patch) | |
tree | a1b439049dee87bc951e190db93f5bbe8b43b0b5 /xserver/render/mirect.c | |
parent | b6bc775539a31f663f9e22ce3ccaf0aa96adf3b6 (diff) |
Update to xserver 1.20.5. Tested by jsg@
Diffstat (limited to 'xserver/render/mirect.c')
-rw-r--r-- | xserver/render/mirect.c | 63 |
1 files changed, 9 insertions, 54 deletions
diff --git a/xserver/render/mirect.c b/xserver/render/mirect.c index a36d1d6e3..65f8d5efd 100644 --- a/xserver/render/mirect.c +++ b/xserver/render/mirect.c @@ -91,8 +91,6 @@ miCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor * color, int nRect, xRectangle *rects) { - ScreenPtr pScreen = pDst->pDrawable->pScreen; - if (color->alpha == 0xffff) { if (op == PictOpOver) op = PictOpSrc; @@ -108,61 +106,18 @@ miCompositeRects(CARD8 op, pDst->alphaOrigin.x, pDst->alphaOrigin.y); } else { - PictFormatPtr rgbaFormat; - PixmapPtr pPixmap; - PicturePtr pSrc; - xRectangle one; int error; - Pixel pixel; - GCPtr pGC; - ChangeGCVal gcvals[2]; - XID tmpval[1]; - - rgbaFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8); - if (!rgbaFormat) - goto bail1; - - pPixmap = (*pScreen->CreatePixmap) (pScreen, 1, 1, rgbaFormat->depth, - CREATE_PIXMAP_USAGE_SCRATCH); - if (!pPixmap) - goto bail2; - - miRenderColorToPixel(rgbaFormat, color, &pixel); + PicturePtr pSrc = CreateSolidPicture(0, color, &error); - pGC = GetScratchGC(rgbaFormat->depth, pScreen); - if (!pGC) - goto bail3; - gcvals[0].val = GXcopy; - gcvals[1].val = pixel; + if (pSrc) { + while (nRect--) { + CompositePicture(op, pSrc, 0, pDst, 0, 0, 0, 0, + rects->x, rects->y, + rects->width, rects->height); + rects++; + } - ChangeGC(NullClient, pGC, GCFunction | GCForeground, gcvals); - ValidateGC(&pPixmap->drawable, pGC); - one.x = 0; - one.y = 0; - one.width = 1; - one.height = 1; - (*pGC->ops->PolyFillRect) (&pPixmap->drawable, pGC, 1, &one); - - tmpval[0] = xTrue; - pSrc = CreatePicture(0, &pPixmap->drawable, rgbaFormat, - CPRepeat, tmpval, serverClient, &error); - - if (!pSrc) - goto bail4; - - while (nRect--) { - CompositePicture(op, pSrc, 0, pDst, 0, 0, 0, 0, - rects->x, rects->y, rects->width, rects->height); - rects++; + FreePicture((void *) pSrc, 0); } - - FreePicture((void *) pSrc, 0); - bail4: - FreeScratchGC(pGC); - bail3: - (*pScreen->DestroyPixmap) (pPixmap); - bail2: - bail1: - ; } } |