aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/fb/fbfill.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/fb/fbfill.c')
-rw-r--r--xorg-server/fb/fbfill.c84
1 files changed, 83 insertions, 1 deletions
diff --git a/xorg-server/fb/fbfill.c b/xorg-server/fb/fbfill.c
index de9d6b313..05d81ab77 100644
--- a/xorg-server/fb/fbfill.c
+++ b/xorg-server/fb/fbfill.c
@@ -26,6 +26,88 @@
#include "fb.h"
+static void
+fbTile(FbBits * dst, FbStride dstStride, int dstX, int width, int height,
+ FbBits * tile, FbStride tileStride, int tileWidth, int tileHeight,
+ int alu, FbBits pm, int bpp, int xRot, int yRot)
+{
+ int tileX, tileY;
+ int widthTmp;
+ int h, w;
+ int x, y;
+
+ modulus(-yRot, tileHeight, tileY);
+ y = 0;
+ while (height) {
+ h = tileHeight - tileY;
+ if (h > height)
+ h = height;
+ height -= h;
+ widthTmp = width;
+ x = dstX;
+ modulus(dstX - xRot, tileWidth, tileX);
+ while (widthTmp) {
+ w = tileWidth - tileX;
+ if (w > widthTmp)
+ w = widthTmp;
+ widthTmp -= w;
+ fbBlt(tile + tileY * tileStride,
+ tileStride,
+ tileX,
+ dst + y * dstStride,
+ dstStride, x, w, h, alu, pm, bpp, FALSE, FALSE);
+ x += w;
+ tileX = 0;
+ }
+ y += h;
+ tileY = 0;
+ }
+}
+
+static void
+fbStipple(FbBits * dst, FbStride dstStride,
+ int dstX, int dstBpp,
+ int width, int height,
+ FbStip * stip, FbStride stipStride,
+ int stipWidth, int stipHeight,
+ FbBits fgand, FbBits fgxor,
+ FbBits bgand, FbBits bgxor,
+ int xRot, int yRot)
+{
+ int stipX, stipY, sx;
+ int widthTmp;
+ int h, w;
+ int x, y;
+
+ modulus(-yRot, stipHeight, stipY);
+ modulus(dstX / dstBpp - xRot, stipWidth, stipX);
+ y = 0;
+ while (height) {
+ h = stipHeight - stipY;
+ if (h > height)
+ h = height;
+ height -= h;
+ widthTmp = width;
+ x = dstX;
+ sx = stipX;
+ while (widthTmp) {
+ w = (stipWidth - sx) * dstBpp;
+ if (w > widthTmp)
+ w = widthTmp;
+ widthTmp -= w;
+ fbBltOne(stip + stipY * stipStride,
+ stipStride,
+ sx,
+ dst + y * dstStride,
+ dstStride, x, dstBpp, w, h, fgand, fgxor, bgand, bgxor);
+ x += w;
+ sx = 0;
+ }
+ y += h;
+ stipY = 0;
+ }
+}
+
void
fbFill(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height)
{
@@ -97,7 +179,7 @@ fbFill(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height)
fbStipple(dst + (y + dstYoff) * dstStride, dstStride,
(x + dstXoff) * dstBpp, dstBpp, width * dstBpp, height,
stip, stipStride, stipWidth, stipHeight,
- pPriv->evenStipple, fgand, fgxor, bgand, bgxor,
+ fgand, fgxor, bgand, bgxor,
pGC->patOrg.x + pDrawable->x + dstXoff,
pGC->patOrg.y + pDrawable->y - y);
fbFinishAccess(&pStip->drawable);