Author: tkreuzer
Date: Sun Dec 30 12:32:00 2012
New Revision: 58051
URL:
http://svn.reactos.org/svn/reactos?rev=58051&view=rev
Log:
[DIBLIB]
- Use memmove explicitly in Dib_BitBlt_SRCCOPY_EqSurf and use it for right-to-left copy as
well.
Modified:
branches/dib_rewrite/win32ss/gdi/diblib/BitBlt_SRCCOPY.c
branches/dib_rewrite/win32ss/gdi/diblib/DibLib.h
Modified: branches/dib_rewrite/win32ss/gdi/diblib/BitBlt_SRCCOPY.c
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/diblib/…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/diblib/BitBlt_SRCCOPY.c [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/diblib/BitBlt_SRCCOPY.c [iso-8859-1] Sun Dec 30
12:32:00 2012
@@ -1,6 +1,7 @@
#include "DibLib.h"
+/* This is a fast xlateless memmove version that can be used for R2L as well */
VOID
FASTCALL
Dib_BitBlt_SRCCOPY_EqSurf(PBLTDATA pBltData)
@@ -16,7 +17,8 @@
cLines = pBltData->ulHeight;
while (cLines--)
{
- memcpy(pjDestBase, pjSrcBase, cjWidth);
+ /* Use memmove to handle copying right-to-left with overlap */
+ memmove(pjDestBase, pjSrcBase, cjWidth);
pjDestBase += pBltData->siDst.cjAdvanceY;
pjSrcBase += pBltData->siSrc.cjAdvanceY;
}
@@ -25,18 +27,23 @@
#define Dib_BitBlt_SRCCOPY_S8_D8_EqSurf Dib_BitBlt_SRCCOPY_EqSurf
#define Dib_BitBlt_SRCCOPY_S16_D16_EqSurf Dib_BitBlt_SRCCOPY_EqSurf
#define Dib_BitBlt_SRCCOPY_S24_D24_EqSurf Dib_BitBlt_SRCCOPY_EqSurf
+#define Dib_BitBlt_SRCCOPY_S8_D8_EqSurfR2L Dib_BitBlt_SRCCOPY_EqSurf
+#define Dib_BitBlt_SRCCOPY_S16_D16_EqSurfR2L Dib_BitBlt_SRCCOPY_EqSurf
+#define Dib_BitBlt_SRCCOPY_S24_D24_EqSurfR2L Dib_BitBlt_SRCCOPY_EqSurf
+#define Dib_BitBlt_SRCCOPY_S32_D32_EqSurfR2L Dib_BitBlt_SRCCOPY_EqSurf
-/* special movsd optimization on x86 */
+/* special movsd optimization on x86, only for left-to-right */
#if defined(_M_IX86) || defined(_M_AMD64)
VOID
FASTCALL
Dib_BitBlt_SRCCOPY_S32_D32_EqSurf(PBLTDATA pBltData)
{
- ULONG cLines, cRows = pBltData->ulWidth;
+ ULONG cLines, cRows;
PBYTE pjDestBase = pBltData->siDst.pjBase;
PBYTE pjSrcBase = pBltData->siSrc.pjBase;
/* Loop all lines */
+ cRows = pBltData->ulWidth;
cLines = pBltData->ulHeight;
while (cLines--)
{
Modified: branches/dib_rewrite/win32ss/gdi/diblib/DibLib.h
URL:
http://svn.reactos.org/svn/reactos/branches/dib_rewrite/win32ss/gdi/diblib/…
==============================================================================
--- branches/dib_rewrite/win32ss/gdi/diblib/DibLib.h [iso-8859-1] (original)
+++ branches/dib_rewrite/win32ss/gdi/diblib/DibLib.h [iso-8859-1] Sun Dec 30 12:32:00
2012
@@ -37,7 +37,6 @@
#define __DIB_FUNCTION_NAME_DST2(name, dst_bpp) Dib_ ## name ## _D ## dst_bpp
#define __DIB_FUNCTION_NAME_DST(name, src_bpp, dst_bpp) __DIB_FUNCTION_NAME_DST2(name,
dst_bpp)
#define __DIB_FUNCTION_NAME_SRCDSTEQ(name, src_bpp, dst_bpp)
__PASTE(__DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp), _EqSurf)
-#define __DIB_FUNCTION_NAME_SRCDSTEQL2R(name, src_bpp, dst_bpp)
__PASTE(__DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp), _EqSurfL2R)
#define __DIB_FUNCTION_NAME_SRCDSTEQR2L(name, src_bpp, dst_bpp)
__PASTE(__DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp), _EqSurfR2L)
#define _ReadPixel_1(pjSource, jShift) (((*(pjSource)) >> (jShift)) & 1)