Commit f7207bcd authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Lift fb to xorg-xserver-7.1/1.1 state

Fixes ArcticaProject/nx-libs#640
parent b1c42dc9
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <dix-config.h> #include <dix-config.h>
#endif #endif
#include <string.h>
#include "fb.h" #include "fb.h"
#define InitializeShifts(sx,dx,ls,rs) { \ #define InitializeShifts(sx,dx,ls,rs) { \
...@@ -76,6 +77,29 @@ fbBlt (FbBits *srcLine, ...@@ -76,6 +77,29 @@ fbBlt (FbBits *srcLine,
return; return;
} }
#endif #endif
if (alu == GXcopy && pm == FB_ALLONES && !reverse &&
!(srcX & 7) && !(dstX & 7) && !(width & 7)) {
int i;
CARD8 *src = (CARD8 *) srcLine;
CARD8 *dst = (CARD8 *) dstLine;
srcStride *= sizeof(FbBits);
dstStride *= sizeof(FbBits);
width >>= 3;
src += (srcX >> 3);
dst += (dstX >> 3);
if (!upsidedown)
for (i = 0; i < height; i++)
memcpy(dst + i * dstStride, src + i * srcStride, width);
else
for (i = height - 1; i >= 0; i--)
memcpy(dst + i * dstStride, src + i * srcStride, width);
return;
}
FbInitializeMergeRop(alu, pm); FbInitializeMergeRop(alu, pm);
destInvarient = FbDestInvarientMergeRop(); destInvarient = FbDestInvarientMergeRop();
if (upsidedown) if (upsidedown)
......
...@@ -98,9 +98,13 @@ fbPadPixmap (PixmapPtr pPixmap) ...@@ -98,9 +98,13 @@ fbPadPixmap (PixmapPtr pPixmap)
FbBits mask; FbBits mask;
int height; int height;
int w; int w;
int stride;
int bpp;
_X_UNUSED int xOff, yOff;
fbGetDrawable (&pPixmap->drawable, bits, stride, bpp, xOff, yOff);
width = pPixmap->drawable.width * pPixmap->drawable.bitsPerPixel; width = pPixmap->drawable.width * pPixmap->drawable.bitsPerPixel;
bits = pPixmap->devPrivate.ptr;
height = pPixmap->drawable.height; height = pPixmap->drawable.height;
mask = FbBitsMask (0, width); mask = FbBitsMask (0, width);
while (height--) while (height--)
...@@ -112,7 +116,8 @@ fbPadPixmap (PixmapPtr pPixmap) ...@@ -112,7 +116,8 @@ fbPadPixmap (PixmapPtr pPixmap)
b = b | FbScrRight(b, w); b = b | FbScrRight(b, w);
w <<= 1; w <<= 1;
} }
*bits++ = b; *bits = b;
bits += stride;
} }
} }
......
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
x = (x + ((x >> 8) & 0xff00ff)) >> 8; \ x = (x + ((x >> 8) & 0xff00ff)) >> 8; \
x &= 0xff00ff; \ x &= 0xff00ff; \
x += (y >> 8) & 0xff00ff; \ x += (y >> 8) & 0xff00ff; \
x |= 0x1000100 - ((t >> 8) & 0xff00ff); \ x |= 0x1000100 - ((x >> 8) & 0xff00ff); \
x &= 0xff00ff; \ x &= 0xff00ff; \
x <<= 8; \ x <<= 8; \
x += t; \ x += t; \
......
/* /*
*
* Copyright © 2000 SuSE, Inc. * Copyright © 2000 SuSE, Inc.
* *
* Permission to use, copy, modify, distribute, and sell this software and its * Permission to use, copy, modify, distribute, and sell this software and its
...@@ -98,6 +99,15 @@ typedef struct _Picture *PicturePtr; ...@@ -98,6 +99,15 @@ typedef struct _Picture *PicturePtr;
#define PICT_c8 PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0) #define PICT_c8 PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
#define PICT_g8 PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0) #define PICT_g8 PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
#define PICT_x4a4 PICT_FORMAT(8,PICT_TYPE_A,4,0,0,0)
#define PICT_x4r1g2b1 PICT_FORMAT(8,PICT_TYPE_ARGB,0,1,2,1)
#define PICT_x4b1g2r1 PICT_FORMAT(8,PICT_TYPE_ABGR,0,1,2,1)
#define PICT_x4a1r1g1b1 PICT_FORMAT(8,PICT_TYPE_ARGB,1,1,1,1)
#define PICT_x4a1b1g1r1 PICT_FORMAT(8,PICT_TYPE_ABGR,1,1,1,1)
#define PICT_x4c4 PICT_FORMAT(8,PICT_TYPE_COLOR,0,0,0,0)
#define PICT_x4g4 PICT_FORMAT(8,PICT_TYPE_GRAY,0,0,0,0)
/* 4bpp formats */ /* 4bpp formats */
#define PICT_a4 PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0) #define PICT_a4 PICT_FORMAT(4,PICT_TYPE_A,4,0,0,0)
#define PICT_r1g2b1 PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1) #define PICT_r1g2b1 PICT_FORMAT(4,PICT_TYPE_ARGB,0,1,2,1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment