summaryrefslogtreecommitdiff
path: root/fb/fbpict.c
diff options
context:
space:
mode:
authorSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>2007-04-25 12:09:22 -0400
committerSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>2007-04-25 22:22:22 -0400
commit48c73dfc369fdf8f6023436ebe82bb604f76bb80 (patch)
tree078374854c281acc67d2a86f1c2360d74401bacd /fb/fbpict.c
parent66ba3d758a368bf83d75bab8b08bdb6b34925e40 (diff)
Add function fbCompositeSrcAdd_8888x8x8(), and fix a bug where
srcRepeat = FALSE would be set in the wrong place.
Diffstat (limited to 'fb/fbpict.c')
-rw-r--r--fb/fbpict.c71
1 files changed, 69 insertions, 2 deletions
diff --git a/fb/fbpict.c b/fb/fbpict.c
index db70872b4..b9c463aa5 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -894,6 +894,61 @@ fbCompositeSrcAdd_8888x8888 (CARD8 op,
fbFinishAccess (pSrc->pDrawable);
}
+static void
+fbCompositeSrcAdd_8888x8x8 (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
+{
+ CARD8 *dstLine, *dst;
+ CARD8 *maskLine, *mask;
+ FbStride dstStride, maskStride;
+ CARD16 w;
+ CARD32 src;
+ CARD8 sa;
+
+ fbComposeGetStart (pDst, xDst, yDst, CARD8, dstStride, dstLine, 1);
+ fbComposeGetStart (pMask, xMask, yMask, CARD8, maskStride, maskLine, 1);
+ fbComposeGetSolid (pSrc, src, pDst->format);
+ sa = (src >> 24);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ mask = maskLine;
+ maskLine += maskStride;
+ w = width;
+
+ while (w--)
+ {
+ CARD16 tmp;
+ CARD16 a;
+ CARD32 m, d;
+ CARD32 r;
+
+ a = READ(mask++);
+ d = READ(dst);
+
+ m = FbInU (sa, 0, a, tmp);
+ r = FbAdd (m, d, 0, tmp);
+
+ WRITE(dst++, r);
+ }
+ }
+
+ fbFinishAccess(pDst->pDrawable);
+ fbFinishAccess(pMask->pDrawable);
+}
+
void
fbCompositeSrcAdd_1000x1000 (CARD8 op,
PicturePtr pSrc,
@@ -1587,6 +1642,8 @@ fbComposite (CARD8 op,
default:
break;
}
+ if (func != fbCompositeGeneral)
+ srcRepeat = FALSE;
}
else if (! srcRepeat) /* has mask and non-repeating source */
{
@@ -1669,8 +1726,6 @@ fbComposite (CARD8 op,
}
}
}
- if (func != fbCompositeGeneral)
- srcRepeat = FALSE;
}
else if (maskRepeat &&
pMask->pDrawable->width == 1 &&
@@ -1887,6 +1942,18 @@ fbComposite (CARD8 op,
break;
}
}
+ else
+ {
+ if ((pSrc->format == PICT_a8r8g8b8 ||
+ pSrc->format == PICT_a8b8g8r8) &&
+ fbCanGetSolid (pSrc) &&
+ pMask->format == PICT_a8 &&
+ pDst->format == PICT_a8)
+ {
+ srcRepeat = FALSE;
+ func = fbCompositeSrcAdd_8888x8x8;
+ }
+ }
break;
}