xref: /reactos/win32ss/gdi/diblib/BitBlt_SRCCOPY.c (revision c2c66aff)
1 
2 #include "DibLib.h"
3 
4 VOID
5 FASTCALL
Dib_BitBlt_SRCCOPY_EqSurf(PBLTDATA pBltData)6 Dib_BitBlt_SRCCOPY_EqSurf(PBLTDATA pBltData)
7 {
8     ULONG cLines, cjWidth;
9     PBYTE pjDestBase = pBltData->siDst.pjBase;
10     PBYTE pjSrcBase = pBltData->siSrc.pjBase;
11 
12     /* Calculate the width in bytes */
13     cjWidth = pBltData->ulWidth * pBltData->siDst.jBpp / 8;
14 
15     /* Loop all lines */
16     cLines = pBltData->ulHeight;
17     while (cLines--)
18     {
19         memcpy(pjDestBase, pjSrcBase, cjWidth);
20         pjDestBase += pBltData->siDst.cjAdvanceY;
21         pjSrcBase += pBltData->siSrc.cjAdvanceY;
22     }
23 }
24 
25 #define Dib_BitBlt_SRCCOPY_S8_D8_EqSurf Dib_BitBlt_SRCCOPY_EqSurf
26 #define Dib_BitBlt_SRCCOPY_S16_D16_EqSurf Dib_BitBlt_SRCCOPY_EqSurf
27 #define Dib_BitBlt_SRCCOPY_S24_D24_EqSurf Dib_BitBlt_SRCCOPY_EqSurf
28 
29 /* special movsd optimization on x86 */
30 #if defined(_M_IX86) || defined(_M_AMD64)
31 VOID
32 FASTCALL
Dib_BitBlt_SRCCOPY_S32_D32_EqSurf(PBLTDATA pBltData)33 Dib_BitBlt_SRCCOPY_S32_D32_EqSurf(PBLTDATA pBltData)
34 {
35     ULONG cLines, cRows = pBltData->ulWidth;
36     PBYTE pjDestBase = pBltData->siDst.pjBase;
37     PBYTE pjSrcBase = pBltData->siSrc.pjBase;
38 
39     /* Loop all lines */
40     cLines = pBltData->ulHeight;
41     while (cLines--)
42     {
43         __movsd((PULONG)pjDestBase, (PULONG)pjSrcBase, cRows);
44         pjDestBase += pBltData->siDst.cjAdvanceY;
45         pjSrcBase += pBltData->siSrc.cjAdvanceY;
46     }
47 }
48 #define Dib_BitBlt_SRCCOPY_S32_D32_EqSurf_manual 1
49 #else
50 #define Dib_BitBlt_SRCCOPY_S32_D32_EqSurf Dib_BitBlt_SRCCOPY_EqSurf
51 #endif
52 
53 /* This definition will be checked against in DibLib_BitBlt.h
54    for all "redirected" functions */
55 #define Dib_BitBlt_SRCCOPY_EqSurf_manual 1
56 
57 #define __USES_SOURCE 1
58 #define __USES_PATTERN 0
59 #define __USES_DEST 0
60 #define __USES_MASK 0
61 
62 #define __FUNCTIONNAME BitBlt_SRCCOPY
63 
64 #define _DibDoRop(pBltData, M, D, S, P) ROP_SRCCOPY(D,S,P)
65 
66 #include "DibLib_AllSrcBPP.h"
67 
68 VOID
69 FASTCALL
Dib_BitBlt_SRCCOPY(PBLTDATA pBltData)70 Dib_BitBlt_SRCCOPY(PBLTDATA pBltData)
71 {
72     gapfnBitBlt_SRCCOPY[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData);
73 }
74 
75