aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/fb
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-28 17:35:36 +0100
committermarha <marha@users.sourceforge.net>2014-03-28 17:35:36 +0100
commitcbfb19790917d271b8ca6156554b16acc802719f (patch)
tree830af0dc6e08b5d0c7124fec143e90255f3feee3 /xorg-server/fb
parentd02e6760412c7a96abbc4d0add5dd8d5e83bbe27 (diff)
downloadvcxsrv-cbfb19790917d271b8ca6156554b16acc802719f.tar.gz
vcxsrv-cbfb19790917d271b8ca6156554b16acc802719f.tar.bz2
vcxsrv-cbfb19790917d271b8ca6156554b16acc802719f.zip
libxtrans fontconfig mesa xserver git update 28 Mar 2014
xserver commit a2880699e8f1f576e1a48ebf25e8982463323f84 libxtrans commit 68f60238c4224f954ff6556ae778c72e420175f0 fontconfig commit fcba9ef01c978323fc71c17e455d3cd6ae35edcc mesa commit 029ccd773d01a5f801c809c499516d7b0c4cc3f8
Diffstat (limited to 'xorg-server/fb')
-rw-r--r--xorg-server/fb/fbblt.c60
1 files changed, 33 insertions, 27 deletions
diff --git a/xorg-server/fb/fbblt.c b/xorg-server/fb/fbblt.c
index 72a05f61a..c615106d1 100644
--- a/xorg-server/fb/fbblt.c
+++ b/xorg-server/fb/fbblt.c
@@ -56,42 +56,48 @@ fbBlt(FbBits * srcLine,
int n, nmiddle;
Bool destInvarient;
int startbyte, endbyte;
- int careful;
FbDeclareMergeRop();
+ if (alu == GXcopy && pm == FB_ALLONES &&
+ !(srcX & 7) && !(dstX & 7) && !(width & 7))
+ {
+ CARD8 *src_byte = (CARD8 *) srcLine + (srcX >> 3);
+ CARD8 *dst_byte = (CARD8 *) dstLine + (dstX >> 3);
+ FbStride src_byte_stride = srcStride << (FB_SHIFT - 3);
+ FbStride dst_byte_stride = dstStride << (FB_SHIFT - 3);
+ int width_byte = (width >> 3);
+
+ /* Make sure there's no overlap; we can't use memcpy in that
+ * case as it's not well defined, so fall through to the
+ * general code
+ */
+ if (src_byte + width_byte <= dst_byte ||
+ dst_byte + width_byte <= src_byte)
+ {
+ int i;
+
+ if (!upsidedown)
+ for (i = 0; i < height; i++)
+ MEMCPY_WRAPPED(dst_byte + i * dst_byte_stride,
+ src_byte + i * src_byte_stride,
+ width_byte);
+ else
+ for (i = height - 1; i >= 0; i--)
+ MEMCPY_WRAPPED(dst_byte + i * dst_byte_stride,
+ src_byte + i * src_byte_stride,
+ width_byte);
+
+ return;
+ }
+ }
+
if (bpp == 24 && !FbCheck24Pix(pm)) {
fbBlt24(srcLine, srcStride, srcX, dstLine, dstStride, dstX,
width, height, alu, pm, reverse, upsidedown);
return;
}
- careful = !((srcLine < dstLine && srcLine + width * (bpp >> 3) > dstLine) ||
- (dstLine < srcLine && dstLine + width * (bpp >> 3) > srcLine))
- || (bpp & 7);
-
- if (alu == GXcopy && pm == FB_ALLONES && !careful &&
- !(srcX & 7) && !(dstX & 7) && !(width & 7)) {
- int i;
- CARD8 *tmpsrc = (CARD8 *) srcLine;
- CARD8 *tmpdst = (CARD8 *) dstLine;
-
- srcStride *= sizeof(FbBits);
- dstStride *= sizeof(FbBits);
- width >>= 3;
- tmpsrc += (srcX >> 3);
- tmpdst += (dstX >> 3);
-
- if (!upsidedown)
- for (i = 0; i < height; i++)
- MEMCPY_WRAPPED(tmpdst + i * dstStride, tmpsrc + i * srcStride, width);
- else
- for (i = height - 1; i >= 0; i--)
- MEMCPY_WRAPPED(tmpdst + i * dstStride, tmpsrc + i * srcStride, width);
-
- return;
- }
-
FbInitializeMergeRop(alu, pm);
destInvarient = FbDestInvarientMergeRop();
if (upsidedown) {