From 7c84189ea1dc236bc979bb4bf158ecb1a6b45137 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 1 Aug 2005 22:22:16 +0000 Subject: Bugzilla #3566 Patch #2906 Fix for RENDER, repeating pictures and offscreen memory (Owen Taylor) --- fb/fbpict.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fb/fbpict.c b/fb/fbpict.c index 20d9ad559..ea45480b2 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -1265,30 +1265,34 @@ fbComposite (CARD8 op, x_dst = pbox->x1; if (maskRepeat) { - y_msk = mod (y_msk, pMask->pDrawable->height); + y_msk = mod (y_msk - pMask->pDrawable->y, pMask->pDrawable->height); if (h_this > pMask->pDrawable->height - y_msk) h_this = pMask->pDrawable->height - y_msk; + y_msk += pMask->pDrawable->y; } if (srcRepeat) { - y_src = mod (y_src, pSrc->pDrawable->height); + y_src = mod (y_src - pSrc->pDrawable->y, pSrc->pDrawable->height); if (h_this > pSrc->pDrawable->height - y_src) h_this = pSrc->pDrawable->height - y_src; + y_src += pSrc->pDrawable->y; } while (w) { w_this = w; if (maskRepeat) { - x_msk = mod (x_msk, pMask->pDrawable->width); + x_msk = mod (x_msk - pMask->pDrawable->x, pMask->pDrawable->width); if (w_this > pMask->pDrawable->width - x_msk) w_this = pMask->pDrawable->width - x_msk; + x_msk += pMask->pDrawable->x; } if (srcRepeat) { - x_src = mod (x_src, pSrc->pDrawable->width); + x_src = mod (x_src - pSrc->pDrawable->x, pSrc->pDrawable->width); if (w_this > pSrc->pDrawable->width - x_src) w_this = pSrc->pDrawable->width - x_src; + x_src += pSrc->pDrawable->x; } (*func) (op, pSrc, pMask, pDst, x_src, y_src, x_msk, y_msk, x_dst, y_dst, -- cgit v1.2.3