From 252df91f2c85997f9fdc474a65380028e0469d80 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 15 Mar 2012 19:11:12 +0000 Subject: [PATCH] [WIN32K] Add new dibcode, currently as a static library. Not used, not built. svn path=/trunk/; revision=56157 --- .../subsystems/win32/win32k/diblib/BitBlt.c | 27 + .../win32/win32k/diblib/BitBlt_DSTINVERT.c | 20 + .../win32/win32k/diblib/BitBlt_MERGECOPY.c | 35 + .../win32/win32k/diblib/BitBlt_MERGEPAINT.c | 22 + .../win32/win32k/diblib/BitBlt_NOTPATCOPY.c | 36 + .../win32/win32k/diblib/BitBlt_NOTSRCCOPY.c | 22 + .../win32/win32k/diblib/BitBlt_NOTSRCERASE.c | 22 + .../win32/win32k/diblib/BitBlt_PATCOPY.c | 36 + .../win32/win32k/diblib/BitBlt_PATINVERT.c | 36 + .../win32/win32k/diblib/BitBlt_PATPAINT.c | 36 + .../win32/win32k/diblib/BitBlt_SRCAND.c | 22 + .../win32/win32k/diblib/BitBlt_SRCCOPY.c | 22 + .../win32/win32k/diblib/BitBlt_SRCERASE.c | 22 + .../win32/win32k/diblib/BitBlt_SRCINVERT.c | 22 + .../win32/win32k/diblib/BitBlt_SRCPAINT.c | 22 + .../win32/win32k/diblib/BitBlt_other.c | 29 + .../win32/win32k/diblib/CMakeLists.txt | 36 + .../subsystems/win32/win32k/diblib/DibLib.c | 316 ++++ .../subsystems/win32/win32k/diblib/DibLib.h | 66 + .../win32/win32k/diblib/DibLib_AllDstBPP.h | 46 + .../win32/win32k/diblib/DibLib_AllSrcBPP.h | 105 ++ .../win32/win32k/diblib/DibLib_BitBlt.h | 130 ++ .../win32/win32k/diblib/DibLib_interface.h | 66 + .../subsystems/win32/win32k/diblib/MaskBlt.c | 29 + .../subsystems/win32/win32k/diblib/MaskCopy.c | 35 + .../win32/win32k/diblib/MaskPaint.c | 25 + .../win32/win32k/diblib/MaskPatBlt.c | 26 + .../win32/win32k/diblib/MaskPatPaint.c | 38 + .../win32/win32k/diblib/MaskSrcBlt.c | 23 + .../win32/win32k/diblib/MaskSrcPaint.c | 21 + .../win32/win32k/diblib/MaskSrcPatBlt.c | 27 + .../subsystems/win32/win32k/diblib/PatPaint.c | 38 + .../win32/win32k/diblib/RopFunctions.c | 1547 +++++++++++++++++ .../win32/win32k/diblib/RopFunctions.h | 282 +++ .../subsystems/win32/win32k/diblib/SrcPaint.c | 24 + .../win32/win32k/diblib/SrcPatBlt.c | 37 + .../win32/win32k/diblib/engbitblt.c | 282 +++ 37 files changed, 3630 insertions(+) create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_DSTINVERT.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_MERGECOPY.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_MERGEPAINT.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_NOTPATCOPY.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_NOTSRCCOPY.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_NOTSRCERASE.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_PATCOPY.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_PATINVERT.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_PATPAINT.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_SRCAND.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_SRCCOPY.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_SRCERASE.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_SRCINVERT.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_SRCPAINT.c create mode 100644 reactos/subsystems/win32/win32k/diblib/BitBlt_other.c create mode 100644 reactos/subsystems/win32/win32k/diblib/CMakeLists.txt create mode 100644 reactos/subsystems/win32/win32k/diblib/DibLib.c create mode 100644 reactos/subsystems/win32/win32k/diblib/DibLib.h create mode 100644 reactos/subsystems/win32/win32k/diblib/DibLib_AllDstBPP.h create mode 100644 reactos/subsystems/win32/win32k/diblib/DibLib_AllSrcBPP.h create mode 100644 reactos/subsystems/win32/win32k/diblib/DibLib_BitBlt.h create mode 100644 reactos/subsystems/win32/win32k/diblib/DibLib_interface.h create mode 100644 reactos/subsystems/win32/win32k/diblib/MaskBlt.c create mode 100644 reactos/subsystems/win32/win32k/diblib/MaskCopy.c create mode 100644 reactos/subsystems/win32/win32k/diblib/MaskPaint.c create mode 100644 reactos/subsystems/win32/win32k/diblib/MaskPatBlt.c create mode 100644 reactos/subsystems/win32/win32k/diblib/MaskPatPaint.c create mode 100644 reactos/subsystems/win32/win32k/diblib/MaskSrcBlt.c create mode 100644 reactos/subsystems/win32/win32k/diblib/MaskSrcPaint.c create mode 100644 reactos/subsystems/win32/win32k/diblib/MaskSrcPatBlt.c create mode 100644 reactos/subsystems/win32/win32k/diblib/PatPaint.c create mode 100644 reactos/subsystems/win32/win32k/diblib/RopFunctions.c create mode 100644 reactos/subsystems/win32/win32k/diblib/RopFunctions.h create mode 100644 reactos/subsystems/win32/win32k/diblib/SrcPaint.c create mode 100644 reactos/subsystems/win32/win32k/diblib/SrcPatBlt.c create mode 100644 reactos/subsystems/win32/win32k/diblib/engbitblt.c diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt.c b/reactos/subsystems/win32/win32k/diblib/BitBlt.c new file mode 100644 index 00000000000..f494f90d76a --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt.c @@ -0,0 +1,27 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 1 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[0](D,S,P) + +#define __FUNCTIONNAME BitBlt +#include "DibLib_AllSrcBPP.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME BitBlt_Solid +#define __USES_SOLID_BRUSH 1 +#include "DibLib_AllSrcBPP.h" + +VOID +FASTCALL +Dib_BitBlt(PBLTDATA pBltData) +{ + gapfnBitBlt[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + + + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_DSTINVERT.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_DSTINVERT.c new file mode 100644 index 00000000000..0e3fd50b9cb --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_DSTINVERT.c @@ -0,0 +1,20 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 0 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define _DibDoRop(pBltData, M, D, S, P) ROP_DSTINVERT(D,S,P) + +#define __FUNCTIONNAME BitBlt_DSTINVERT +#include "DibLib_AllDstBPP.h" + +VOID +FASTCALL +Dib_BitBlt_DSTINVERT(PBLTDATA pBltData) +{ + gapfnBitBlt_DSTINVERT[pBltData->siDst.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_MERGECOPY.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_MERGECOPY.c new file mode 100644 index 00000000000..dccdba235ca --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_MERGECOPY.c @@ -0,0 +1,35 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 1 +#define __USES_DEST 0 +#define __USES_MASK 0 + +#define _DibDoRop(pBltData, M, D, S, P) ROP_MERGECOPY(D,S,P) + +#define __FUNCTIONNAME BitBlt_MERGECOPY +#include "DibLib_AllSrcBPP.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME BitBlt_MERGECOPY_Solid +#define __USES_SOLID_BRUSH 1 +#include "DibLib_AllSrcBPP.h" + +VOID +FASTCALL +Dib_BitBlt_MERGECOPY(PBLTDATA pBltData) +{ + /* Check for solid brush */ + if (pBltData->ulSolidColor != 0xFFFFFFFF) + { + /* Use the solid version of PATCOPY! */ + gapfnBitBlt_MERGECOPY_Solid[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); + } + else + { + /* Use the pattern version */ + gapfnBitBlt_MERGECOPY[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); + } +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_MERGEPAINT.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_MERGEPAINT.c new file mode 100644 index 00000000000..14ee4334afb --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_MERGEPAINT.c @@ -0,0 +1,22 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_MERGEPAINT + +#define _DibDoRop(pBltData, M, D, S, P) ROP_MERGEPAINT(D,S,P) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_BitBlt_MERGEPAINT(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnBitBlt_MERGEPAINT[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_NOTPATCOPY.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_NOTPATCOPY.c new file mode 100644 index 00000000000..91787f95e21 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_NOTPATCOPY.c @@ -0,0 +1,36 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 0 +#define __USES_PATTERN 1 +#define __USES_DEST 0 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_NOTPATCOPY + +#define _DibDoRop(pBltData, M, D, S, P) (~(P)) + +#include "diblib_alldstbpp.h" + +extern PFN_DIBFUNCTION gapfnBitBlt_PATCOPY_Solid[]; + +VOID +FASTCALL +Dib_BitBlt_NOTPATCOPY(PBLTDATA pBltData) +{ + /* Check for solid brush */ + if (pBltData->ulSolidColor != 0xFFFFFFFF) + { + /* Prepare inverted colot */ + pBltData->ulSolidColor = ~pBltData->ulSolidColor; + + /* Use the solid version of PATCOPY! */ + gapfnBitBlt_PATCOPY_Solid[pBltData->siDst.iFormat](pBltData); + } + else + { + /* Use the pattern version */ + gapfnBitBlt_NOTPATCOPY[pBltData->siDst.iFormat](pBltData); + } +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_NOTSRCCOPY.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_NOTSRCCOPY.c new file mode 100644 index 00000000000..2d9441d9b8d --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_NOTSRCCOPY.c @@ -0,0 +1,22 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 0 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_NOTSRCCOPY + +#define _DibDoRop(pBltData, M, D, S, P) ROP_NOTSRCCOPY(D,S,P) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_BitBlt_NOTSRCCOPY(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnBitBlt_NOTSRCCOPY[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_NOTSRCERASE.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_NOTSRCERASE.c new file mode 100644 index 00000000000..51a50c1fe6b --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_NOTSRCERASE.c @@ -0,0 +1,22 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_NOTSRCERASE + +#define _DibDoRop(pBltData, M, D, S, P) ROP_NOTSRCERASE(D,S,P) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_BitBlt_NOTSRCERASE(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnBitBlt_NOTSRCERASE[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_PATCOPY.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_PATCOPY.c new file mode 100644 index 00000000000..5adc722a1c6 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_PATCOPY.c @@ -0,0 +1,36 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 0 +#define __USES_PATTERN 1 +#define __USES_DEST 0 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_PATCOPY + +#define _DibDoRop(pBltData, M, D, S, P) ROP_PATCOPY(D,S,P) + +#include "diblib_alldstbpp.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME BitBlt_PATCOPY_Solid +#define __USES_SOLID_BRUSH 1 +#include "diblib_alldstbpp.h" + +VOID +FASTCALL +Dib_BitBlt_PATCOPY(PBLTDATA pBltData) +{ + /* Check for solid brush */ + if (pBltData->ulSolidColor != 0xFFFFFFFF) + { + /* Use the solid version of PATCOPY! */ + gapfnBitBlt_PATCOPY_Solid[pBltData->siDst.iFormat](pBltData); + } + else + { + /* Use the pattern version */ + gapfnBitBlt_PATCOPY[pBltData->siDst.iFormat](pBltData); + } +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_PATINVERT.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_PATINVERT.c new file mode 100644 index 00000000000..311614ca399 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_PATINVERT.c @@ -0,0 +1,36 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 0 +#define __USES_PATTERN 1 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_PATINVERT + +#define _DibDoRop(pBltData, M, D, S, P) ROP_PATINVERT(D,S,P) + +#include "diblib_alldstbpp.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME BitBlt_PATINVERT_Solid +#define __USES_SOLID_BRUSH 1 +#include "diblib_alldstbpp.h" + +VOID +FASTCALL +Dib_BitBlt_PATINVERT(PBLTDATA pBltData) +{ + /* Check for solid brush */ + if (pBltData->ulSolidColor != 0xFFFFFFFF) + { + /* Use the solid version of PATCOPY! */ + gapfnBitBlt_PATINVERT_Solid[pBltData->siDst.iFormat](pBltData); + } + else + { + /* Use the pattern version */ + gapfnBitBlt_PATINVERT[pBltData->siDst.iFormat](pBltData); + } +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_PATPAINT.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_PATPAINT.c new file mode 100644 index 00000000000..e6e0fa17d02 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_PATPAINT.c @@ -0,0 +1,36 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 1 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_PATPAINT + +#define _DibDoRop(pBltData, M, D, S, P) ROP_PATPAINT(D,S,P) + +#include "diblib_allsrcbpp.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME BitBlt_PATPAINT_Solid +#define __USES_SOLID_BRUSH 1 +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_BitBlt_PATPAINT(PBLTDATA pBltData) +{ + /* Check for solid brush */ + if (pBltData->ulSolidColor != 0xFFFFFFFF) + { + /* Use the solid version of PATCOPY! */ + gapfnBitBlt_PATPAINT_Solid[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); + } + else + { + /* Use the pattern version */ + gapfnBitBlt_PATPAINT[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); + } +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCAND.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCAND.c new file mode 100644 index 00000000000..bb56487bf11 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCAND.c @@ -0,0 +1,22 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_SRCAND + +#define _DibDoRop(pBltData, M, D, S, P) ROP_SRCAND(D,S,P) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_BitBlt_SRCAND(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnBitBlt_SRCAND[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCCOPY.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCCOPY.c new file mode 100644 index 00000000000..62ddec51eff --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCCOPY.c @@ -0,0 +1,22 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 0 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_SRCCOPY + +#define _DibDoRop(pBltData, M, D, S, P) ROP_SRCCOPY(D,S,P) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_BitBlt_SRCCOPY(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnBitBlt_SRCCOPY[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCERASE.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCERASE.c new file mode 100644 index 00000000000..268af45b0c3 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCERASE.c @@ -0,0 +1,22 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_SRCERASE + +#define _DibDoRop(pBltData, M, D, S, P) ROP_SRCERASE(D,S,P) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_BitBlt_SRCERASE(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnBitBlt_SRCERASE[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCINVERT.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCINVERT.c new file mode 100644 index 00000000000..4bf6cfe42fe --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCINVERT.c @@ -0,0 +1,22 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_SRCINVERT + +#define _DibDoRop(pBltData, M, D, S, P) ROP_SRCINVERT(D,S,P) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_BitBlt_SRCINVERT(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnBitBlt_SRCINVERT[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCPAINT.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCPAINT.c new file mode 100644 index 00000000000..fe3cc125378 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCPAINT.c @@ -0,0 +1,22 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME BitBlt_SRCPAINT + +#define _DibDoRop(pBltData, M, D, S, P) ROP_SRCPAINT(D,S,P) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_BitBlt_SRCPAINT(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnBitBlt_SRCPAINT[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/BitBlt_other.c b/reactos/subsystems/win32/win32k/diblib/BitBlt_other.c new file mode 100644 index 00000000000..f21e7e332d8 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/BitBlt_other.c @@ -0,0 +1,29 @@ + +#include "DibLib.h" + +extern PFN_DIBFUNCTION gapfnBitBlt_PATCOPY_Solid[]; + +VOID +FASTCALL +Dib_BitBlt_BLACKNESS(PBLTDATA pBltData) +{ + /* Pass it to the colorfil function */ + pBltData->ulSolidColor = XLATEOBJ_iXlate(pBltData->pxlo, 0); + gapfnBitBlt_PATCOPY_Solid[pBltData->siDst.iFormat](pBltData); +} + +VOID +FASTCALL +Dib_BitBlt_WHITENESS(PBLTDATA pBltData) +{ + /* Pass it to the colorfil function */ + pBltData->ulSolidColor = XLATEOBJ_iXlate(pBltData->pxlo, 0xFFFFFF); + gapfnBitBlt_PATCOPY_Solid[pBltData->siDst.iFormat](pBltData); +} + +VOID +FASTCALL +Dib_BitBlt_NOOP(PBLTDATA pBltData) +{ + UNREFERENCED_PARAMETER(pBltData); +} diff --git a/reactos/subsystems/win32/win32k/diblib/CMakeLists.txt b/reactos/subsystems/win32/win32k/diblib/CMakeLists.txt new file mode 100644 index 00000000000..87d6fa23449 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/CMakeLists.txt @@ -0,0 +1,36 @@ + + +list(APPEND DIBLIB_SOURCE + BitBlt.c + BitBlt_DSTINVERT.c + BitBlt_MERGECOPY.c + BitBlt_MERGEPAINT.c + BitBlt_NOTPATCOPY.c + BitBlt_NOTSRCCOPY.c + BitBlt_NOTSRCERASE.c + BitBlt_other.c + BitBlt_PATCOPY.c + BitBlt_PATINVERT.c + BitBlt_PATPAINT.c + BitBlt_SRCAND.c + BitBlt_SRCCOPY.c + BitBlt_SRCERASE.c + BitBlt_SRCINVERT.c + BitBlt_SRCPAINT.c + DibLib.c + MaskBlt.c + MaskCopy.c + MaskPaint.c + MaskPatBlt.c + MaskPatPaint.c + MaskSrcBlt.c + MaskSrcPaint.c + MaskSrcPatBlt.c + PatPaint.c + RopFunctions.c + SrcPaint.c + SrcPatBlt.c +) + +add_library(diblib ${DIBLIB_SOURCE}) + diff --git a/reactos/subsystems/win32/win32k/diblib/DibLib.c b/reactos/subsystems/win32/win32k/diblib/DibLib.c new file mode 100644 index 00000000000..c62e8dcfe52 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/DibLib.c @@ -0,0 +1,316 @@ + +#include "DibLib.h" + +enum +{ + INDEX_BitBlt_NOOP, + INDEX_BitBlt_DSTINVERT, + INDEX_BitBlt_BLACKNESS, + INDEX_BitBlt_WHITENESS, + INDEX_BitBlt_PATCOPY, + INDEX_BitBlt_NOTPATCOPY, + INDEX_BitBlt_SRCCOPY, + INDEX_BitBlt_NOTSRCCOPY, + INDEX_BitBlt_SRCERASE, + INDEX_BitBlt_NOTSRCERASE, + INDEX_BitBlt_PATINVERT, + INDEX_BitBlt_SRCINVERT, + INDEX_BitBlt_SRCAND, + INDEX_BitBlt_MERGEPAINT, + INDEX_BitBlt_MERGECOPY, + INDEX_BitBlt_SRCPAINT, + INDEX_BitBlt_PATPAINT, + INDEX_SrcPatBlt, + INDEX_PatPaint, + INDEX_SrcPaint, + INDEX_BitBlt, +}; + + +PFN_DIBFUNCTION +apfnDibFunction[] = +{ + Dib_BitBlt_NOOP, + Dib_BitBlt_DSTINVERT, + Dib_BitBlt_BLACKNESS, + Dib_BitBlt_WHITENESS, + Dib_BitBlt_PATCOPY, + Dib_BitBlt_NOTPATCOPY, + Dib_BitBlt_SRCCOPY, + Dib_BitBlt_NOTSRCCOPY, + Dib_BitBlt_SRCERASE, + Dib_BitBlt_NOTSRCERASE, + Dib_BitBlt_PATINVERT, + Dib_BitBlt_SRCINVERT, + Dib_BitBlt_SRCAND, + Dib_BitBlt_MERGEPAINT, + Dib_BitBlt_MERGECOPY, + Dib_BitBlt_SRCPAINT, + Dib_BitBlt_PATPAINT, + Dib_SrcPatBlt, + Dib_PatPaint, + Dib_SrcPaint, + Dib_BitBlt, +}; + +UCHAR +aiIndexPerRop[256] = +{ + INDEX_BitBlt_BLACKNESS, // BLACKNESS + INDEX_BitBlt, // DPSoon, + INDEX_BitBlt, // DPSona, + INDEX_SrcPatBlt, // PSon, + INDEX_BitBlt, // SDPona, + INDEX_PatPaint, // DPon, + INDEX_BitBlt, // PDSxnon, + INDEX_BitBlt, // PDSaon, + INDEX_BitBlt, // SDPnaa, + INDEX_BitBlt, // PDSxon, + INDEX_PatPaint, // DPna, + INDEX_BitBlt, // PSDnaon, + INDEX_SrcPatBlt, // SPna, + INDEX_BitBlt, // PDSnaon, + INDEX_BitBlt, // PDSonon, + INDEX_BitBlt_NOTPATCOPY, // Pn, + INDEX_BitBlt, // PDSona, + INDEX_BitBlt_NOTSRCERASE, // DSon / NOTSRCERASE + INDEX_BitBlt, // SDPxnon, + INDEX_BitBlt, // SDPaon, + INDEX_BitBlt, // DPSxnon, + INDEX_BitBlt, // DPSaon, + INDEX_BitBlt, // PSDPSanaxx, + INDEX_BitBlt, // SSPxDSxaxn, + INDEX_BitBlt, // SPxPDxa, + INDEX_BitBlt, // SDPSanaxn, + INDEX_BitBlt, // PDSPaox, + INDEX_BitBlt, // SDPSxaxn, + INDEX_BitBlt, // PSDPaox, + INDEX_BitBlt, // DSPDxaxn, + INDEX_BitBlt, // PDSox, + INDEX_BitBlt, // PDSoan, + INDEX_BitBlt, // DPSnaa, + INDEX_BitBlt, // SDPxon, + INDEX_SrcPaint, // DSna, + INDEX_BitBlt, // SPDnaon, + INDEX_BitBlt, // SPxDSxa, + INDEX_BitBlt, // PDSPanaxn, + INDEX_BitBlt, // SDPSaox, + INDEX_BitBlt, // SDPSxnox, + INDEX_BitBlt, // DPSxa, + INDEX_BitBlt, // PSDPSaoxxn, + INDEX_BitBlt, // DPSana, + INDEX_BitBlt, // SSPxPDxaxn, + INDEX_BitBlt, // SPDSoax, + INDEX_BitBlt, // PSDnox, + INDEX_BitBlt, // PSDPxox, + INDEX_BitBlt, // PSDnoan, + INDEX_SrcPatBlt, // PSna, + INDEX_BitBlt, // SDPnaon, + INDEX_BitBlt, // SDPSoox, + INDEX_BitBlt_NOTSRCCOPY, // Sn / NOTSRCCOPY + INDEX_BitBlt, // SPDSaox, + INDEX_BitBlt, // SPDSxnox, + INDEX_BitBlt, // SDPox, + INDEX_BitBlt, // SDPoan, + INDEX_BitBlt, // PSDPoax, + INDEX_BitBlt, // SPDnox, + INDEX_BitBlt, // SPDSxox, + INDEX_BitBlt, // SPDnoan, + INDEX_SrcPatBlt, // PSx, + INDEX_BitBlt, // SPDSonox, + INDEX_BitBlt, // SPDSnaox, + INDEX_SrcPatBlt, // PSan, + INDEX_BitBlt, // PSDnaa, + INDEX_BitBlt, // DPSxon, + INDEX_BitBlt, // SDxPDxa, + INDEX_BitBlt, // SPDSanaxn, + INDEX_BitBlt_SRCERASE, // SDna / SRCERASE + INDEX_BitBlt, // DPSnaon, + INDEX_BitBlt, // DSPDaox, + INDEX_BitBlt, // PSDPxaxn, + INDEX_BitBlt, // SDPxa, + INDEX_BitBlt, // PDSPDaoxxn, + INDEX_BitBlt, // DPSDoax, + INDEX_BitBlt, // PDSnox, + INDEX_BitBlt, // SDPana, + INDEX_BitBlt, // SSPxDSxoxn, + INDEX_BitBlt, // PDSPxox, + INDEX_BitBlt, // PDSnoan, + INDEX_PatPaint, // PDna, + INDEX_BitBlt, // DSPnaon, + INDEX_BitBlt, // DPSDaox, + INDEX_BitBlt, // SPDSxaxn, + INDEX_BitBlt, // DPSonon, + INDEX_BitBlt_DSTINVERT, // Dn / DSTINVERT + INDEX_BitBlt, // DPSox, + INDEX_BitBlt, // DPSoan, + INDEX_BitBlt, // PDSPoax, + INDEX_BitBlt, // DPSnox, + INDEX_BitBlt_PATINVERT, // DPx / PATINVERT + INDEX_BitBlt, // DPSDonox, + INDEX_BitBlt, // DPSDxox, + INDEX_BitBlt, // DPSnoan, + INDEX_BitBlt, // DPSDnaox, + INDEX_PatPaint, // DPan, + INDEX_BitBlt, // PDSxa, + INDEX_BitBlt, // DSPDSaoxxn, + INDEX_BitBlt, // DSPDoax, + INDEX_BitBlt, // SDPnox, + INDEX_BitBlt, // SDPSoax, + INDEX_BitBlt, // DSPnox, + INDEX_BitBlt_SRCINVERT, // DSx / SRCINVERT + INDEX_BitBlt, // SDPSonox, + INDEX_BitBlt, // DSPDSonoxxn, + INDEX_BitBlt, // PDSxxn, + INDEX_BitBlt, // DPSax, + INDEX_BitBlt, // PSDPSoaxxn, + INDEX_BitBlt, // SDPax, + INDEX_BitBlt, // PDSPDoaxxn, + INDEX_BitBlt, // SDPSnoax, + INDEX_BitBlt, // PDSxnan, + INDEX_BitBlt, // PDSana, + INDEX_BitBlt, // SSDxPDxaxn, + INDEX_BitBlt, // SDPSxox, + INDEX_BitBlt, // SDPnoan, + INDEX_BitBlt, // DSPDxox, + INDEX_BitBlt, // DSPnoan, + INDEX_BitBlt, // SDPSnaox, + INDEX_SrcPaint, // DSan, + INDEX_BitBlt, // PDSax, + INDEX_BitBlt, // DSPDSoaxxn, + INDEX_BitBlt, // DPSDnoax, + INDEX_BitBlt, // SDPxnan, + INDEX_BitBlt, // SPDSnoax, + INDEX_BitBlt, // DPSxnan, + INDEX_BitBlt, // SPxDSxo, + INDEX_BitBlt, // DPSaan, + INDEX_BitBlt, // DPSaa, + INDEX_BitBlt, // SPxDSxon, + INDEX_BitBlt, // DPSxna, + INDEX_BitBlt, // SPDSnoaxn, + INDEX_BitBlt, // SDPxna, + INDEX_BitBlt, // PDSPnoaxn, + INDEX_BitBlt, // DSPDSoaxx, + INDEX_BitBlt, // PDSaxn, + INDEX_BitBlt_SRCAND, // DSa / SRCAND + INDEX_BitBlt, // SDPSnaoxn, + INDEX_BitBlt, // DSPnoa, + INDEX_BitBlt, // DSPDxoxn, + INDEX_BitBlt, // SDPnoa, + INDEX_BitBlt, // SDPSxoxn, + INDEX_BitBlt, // SSDxPDxax, + INDEX_BitBlt, // PDSanan, + INDEX_BitBlt, // PDSxna, + INDEX_BitBlt, // SDPSnoaxn, + INDEX_BitBlt, // DPSDPoaxx, + INDEX_BitBlt, // SPDaxn, + INDEX_BitBlt, // PSDPSoaxx, + INDEX_BitBlt, // DPSaxn, + INDEX_BitBlt, // DPSxx, + INDEX_BitBlt, // PSDPSonoxx, + INDEX_BitBlt, // SDPSonoxn, + INDEX_SrcPaint, // DSxn, + INDEX_BitBlt, // DPSnax, + INDEX_BitBlt, // SDPSoaxn, + INDEX_BitBlt, // SPDnax, + INDEX_BitBlt, // DSPDoaxn, + INDEX_BitBlt, // DSPDSaoxx, + INDEX_BitBlt, // PDSxan, + INDEX_PatPaint, // DPa, + INDEX_BitBlt, // PDSPnaoxn, + INDEX_BitBlt, // DPSnoa, + INDEX_BitBlt, // DPSDxoxn, + INDEX_BitBlt, // PDSPonoxn, + INDEX_PatPaint, // PDxn, + INDEX_BitBlt, // DSPnax, + INDEX_BitBlt, // PDSPoaxn, + INDEX_BitBlt, // DPSoa, + INDEX_BitBlt, // DPSoxn, + INDEX_BitBlt_NOOP, // D, + INDEX_BitBlt, // DPSono, + INDEX_BitBlt, // SPDSxax, + INDEX_BitBlt, // DPSDaoxn, + INDEX_BitBlt, // DSPnao, + INDEX_PatPaint, // DPno, + INDEX_BitBlt, // PDSnoa, + INDEX_BitBlt, // PDSPxoxn, + INDEX_BitBlt, // SSPxDSxox, + INDEX_BitBlt, // SDPanan, + INDEX_BitBlt, // PSDnax, + INDEX_BitBlt, // DPSDoaxn, + INDEX_BitBlt, // DPSDPaoxx, + INDEX_BitBlt, // SDPxan, + INDEX_BitBlt, // PSDPxax, + INDEX_BitBlt, // DSPDaoxn, + INDEX_BitBlt, // DPSnao, + INDEX_BitBlt_MERGEPAINT, // DSno / MERGEPAINT + INDEX_BitBlt, // SPDSanax, + INDEX_BitBlt, // SDxPDxan, + INDEX_BitBlt, // DPSxo, + INDEX_BitBlt, // DPSano, + INDEX_BitBlt_MERGECOPY, // PSa / MERGECOPY + INDEX_BitBlt, // SPDSnaoxn, + INDEX_BitBlt, // SPDSonoxn, + INDEX_SrcPatBlt, // PSxn, + INDEX_BitBlt, // SPDnoa, + INDEX_BitBlt, // SPDSxoxn, + INDEX_BitBlt, // SDPnax, + INDEX_BitBlt, // PSDPoaxn, + INDEX_BitBlt, // SDPoa, + INDEX_BitBlt, // SPDoxn, + INDEX_BitBlt, // DPSDxax, + INDEX_BitBlt, // SPDSaoxn, + INDEX_BitBlt_SRCCOPY, // S / SRCCOPY + INDEX_BitBlt, // SDPono, + INDEX_BitBlt, // SDPnao, + INDEX_SrcPatBlt, // SPno, + INDEX_BitBlt, // PSDnoa, + INDEX_BitBlt, // PSDPxoxn, + INDEX_BitBlt, // PDSnax, + INDEX_BitBlt, // SPDSoaxn, + INDEX_BitBlt, // SSPxPDxax, + INDEX_BitBlt, // DPSanan, + INDEX_BitBlt, // PSDPSaoxx, + INDEX_BitBlt, // DPSxan, + INDEX_BitBlt, // PDSPxax, + INDEX_BitBlt, // SDPSaoxn, + INDEX_BitBlt, // DPSDanax, + INDEX_BitBlt, // SPxDSxan, + INDEX_BitBlt, // SPDnao, + INDEX_SrcPaint, // SDno, + INDEX_BitBlt, // SDPxo, + INDEX_BitBlt, // SDPano, + INDEX_BitBlt, // PDSoa, + INDEX_BitBlt, // PDSoxn, + INDEX_BitBlt, // DSPDxax, + INDEX_BitBlt, // PSDPaoxn, + INDEX_BitBlt, // SDPSxax, + INDEX_BitBlt, // PDSPaoxn, + INDEX_BitBlt, // SDPSanax, + INDEX_BitBlt, // SPxPDxan, + INDEX_BitBlt, // SSPxDSxax, + INDEX_BitBlt, // DSPDSanaxxn, + INDEX_BitBlt, // DPSao, + INDEX_BitBlt, // DPSxno, + INDEX_BitBlt, // SDPao, + INDEX_BitBlt, // SDPxno, + INDEX_BitBlt_SRCPAINT, // DSo / SRCPAINT + INDEX_BitBlt, // SDPnoo, + INDEX_BitBlt_PATCOPY, // P / PATCOPY + INDEX_BitBlt, // PDSono, + INDEX_BitBlt, // PDSnao, + INDEX_SrcPatBlt, // PSno, + INDEX_BitBlt, // PSDnao, + INDEX_PatPaint, // PDno, + INDEX_BitBlt, // PDSxo, + INDEX_BitBlt, // PDSano, + INDEX_BitBlt, // PDSao, + INDEX_BitBlt, // PDSxno, + INDEX_PatPaint, // DPo, + INDEX_BitBlt_PATPAINT, // DPSnoo, // PATPAINT + INDEX_SrcPatBlt, // PSo, + INDEX_BitBlt, // PSDnoo, + INDEX_BitBlt, // DPSoo, + INDEX_BitBlt_WHITENESS //WHITENESS +}; + diff --git a/reactos/subsystems/win32/win32k/diblib/DibLib.h b/reactos/subsystems/win32/win32k/diblib/DibLib.h new file mode 100644 index 00000000000..50ae83ffabb --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/DibLib.h @@ -0,0 +1,66 @@ + +#ifdef _MSC_VER +#pragma warning(disable:4711) +#endif + +#define FASTCALL __fastcall + +#include +#include +#include +#include +#include "DibLib_interface.h" + +#define _DibXlate(pBltData, ulColor) (pBltData->pfnXlate(pBltData->pxlo, ulColor)) + +#define __PASTE_(s1,s2) s1##s2 +#define __PASTE(s1,s2) __PASTE_(s1,s2) + +#define __DIB_FUNCTION_NAME_SRCDSTEQ2(name, src_bpp, dst_bpp) Dib_ ## name ## _S ## src_bpp ## _D ## dst_bpp ## _EqSurf +#define __DIB_FUNCTION_NAME_SRCDSTEQ(name, src_bpp, dst_bpp) __DIB_FUNCTION_NAME_SRCDSTEQ2(name, src_bpp, dst_bpp) + +#define __DIB_FUNCTION_NAME_SRCDSTEQR2L2(name, src_bpp, dst_bpp) Dib_ ## name ## _S ## src_bpp ## _D ## dst_bpp ## _EqSurfR2L +#define __DIB_FUNCTION_NAME_SRCDSTEQR2L(name, src_bpp, dst_bpp) __DIB_FUNCTION_NAME_SRCDSTEQR2L2(name, src_bpp, dst_bpp) + +#define __DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp) Dib_ ## name ## _S ## src_bpp ## _D ## dst_bpp +#define __DIB_FUNCTION_NAME_SRCDST(name, src_bpp, dst_bpp) __DIB_FUNCTION_NAME_SRCDST2(name, src_bpp, dst_bpp) + +#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 _ReadPixel_1(pjSource, jShift) (((*(pjSource)) >> (jShift)) & 1) +#define _WritePixel_1(pjDest, jShift, ulColor) (void)(*(pjDest) = (UCHAR)((*(pjDest) & ~(1<<(jShift))) | ((ulColor)<<(jShift)))) +#define _NextPixel_1(ppj, pjShift) (void)((*(pjShift))--, *(pjShift) &= 7, (*(ppj) += (*(pjShift) >> 5))) +#define _NextPixelR2L_1(ppj, pjShift) (void)((*(ppj) -= (*(pjShift) >> 5)), (*(pjShift))++, *(pjShift) &= 7) +#define _SHIFT_1(x) x + +#define _ReadPixel_4(pjSource, jShift) (((*(pjSource)) >> (jShift)) & 15) +#define _WritePixel_4(pjDest, jShift, ulColor) (void)(*(pjDest) = (UCHAR)((*(pjDest) & ~(15<<(jShift))) | ((ulColor)<<(jShift)))) +#define _NextPixel_4(ppj, pjShift) (void)((*(ppj) += (*(pjShift) & 1)), (*(pjShift)) -= 4, *(pjShift) &= 7) +#define _NextPixelR2L_4(ppj, pjShift) (void)((*(pjShift)) -= 4, *(pjShift) &= 7, (*(ppj) -= (*(pjShift) & 1))) +#define _SHIFT_4(x) x + +#define _ReadPixel_8(pjSource, x) (*(UCHAR*)(pjSource)) +#define _WritePixel_8(pjDest, x, ulColor) (void)(*(UCHAR*)(pjDest) = (UCHAR)(ulColor)) +#define _NextPixel_8(ppj, pjShift) (void)(*(ppj) += 1) +#define _NextPixelR2L_8(ppj, pjShift) (void)(*(ppj) -= 1) +#define _SHIFT_8(x) + +#define _ReadPixel_16(pjSource, x) (*(USHORT*)(pjSource)) +#define _WritePixel_16(pjDest, x, ulColor) (void)(*(USHORT*)(pjDest) = (USHORT)(ulColor)) +#define _NextPixel_16(ppj, pjShift) (void)(*(ppj) -= 2) +#define _NextPixelR2L_16(ppj, pjShift) (void)(*(ppj) += 2) +#define _SHIFT_16(x) + +#define _ReadPixel_24(pjSource, x) ((pjSource)[0] | ((pjSource)[1] << 8) | ((pjSource)[2] << 16)) +#define _WritePixel_24(pjDest, x, ulColor) (void)(((pjDest)[0] = ((ulColor)&0xFF)),((pjDest)[1] = (((ulColor)>>8)&0xFF)),((pjDest)[2] = (((ulColor)>>16)&0xFF))) +#define _NextPixel_24(ppj, pjShift) (void)(*(ppj) -= 3) +#define _NextPixelR2L_24(ppj, pjShift) (void)(*(ppj) += 3) +#define _SHIFT_24(x) + +#define _ReadPixel_32(pjSource, x) (*(ULONG*)(pjSource)) +#define _WritePixel_32(pjDest, x, ulColor) (void)(*(ULONG*)(pjDest) = (ulColor)) +#define _NextPixel_32(ppj, pjShift) (void)(*(ppj) += 4) +#define _NextPixelR2L_32(ppj, pjShift) (void)(*(ppj) -= 4) +#define _SHIFT_32(x) + diff --git a/reactos/subsystems/win32/win32k/diblib/DibLib_AllDstBPP.h b/reactos/subsystems/win32/win32k/diblib/DibLib_AllDstBPP.h new file mode 100644 index 00000000000..b9a5475051b --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/DibLib_AllDstBPP.h @@ -0,0 +1,46 @@ + +#ifndef __DIB_FUNCTION_NAME +#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_DST +#endif + +#ifndef _SOURCE_BPP +#define _SOURCE_BPP 0 +#endif + +#define _DEST_BPP 1 +#include "diblib_bitblt.h" +#undef _DEST_BPP + +#define _DEST_BPP 4 +#include "diblib_bitblt.h" +#undef _DEST_BPP + +#define _DEST_BPP 8 +#include "diblib_bitblt.h" +#undef _DEST_BPP + +#define _DEST_BPP 16 +#include "diblib_bitblt.h" +#undef _DEST_BPP + +#define _DEST_BPP 24 +#include "diblib_bitblt.h" +#undef _DEST_BPP + +#define _DEST_BPP 32 +#include "diblib_bitblt.h" +#undef _DEST_BPP + +#if (__USES_SOURCE == 0) +PFN_DIBFUNCTION +__PASTE(gapfn, __FUNCTIONNAME)[7] = +{ + 0, + __DIB_FUNCTION_NAME_DST(__FUNCTIONNAME, 0, 1), + __DIB_FUNCTION_NAME_DST(__FUNCTIONNAME, 0, 4), + __DIB_FUNCTION_NAME_DST(__FUNCTIONNAME, 0, 8), + __DIB_FUNCTION_NAME_DST(__FUNCTIONNAME, 0, 16), + __DIB_FUNCTION_NAME_DST(__FUNCTIONNAME, 0, 24), + __DIB_FUNCTION_NAME_DST(__FUNCTIONNAME, 0, 32) +}; +#endif diff --git a/reactos/subsystems/win32/win32k/diblib/DibLib_AllSrcBPP.h b/reactos/subsystems/win32/win32k/diblib/DibLib_AllSrcBPP.h new file mode 100644 index 00000000000..b6c03285d31 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/DibLib_AllSrcBPP.h @@ -0,0 +1,105 @@ + +#ifndef __DIB_FUNCTION_NAME +#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_SRCDST +#endif + +#define _SOURCE_BPP 1 +#include "diblib_alldstbpp.h" +#undef _SOURCE_BPP + +#define _SOURCE_BPP 4 +#include "diblib_alldstbpp.h" +#undef _SOURCE_BPP + +#define _SOURCE_BPP 8 +#include "diblib_alldstbpp.h" +#undef _SOURCE_BPP + +#define _SOURCE_BPP 16 +#include "diblib_alldstbpp.h" +#undef _SOURCE_BPP + +#define _SOURCE_BPP 24 +#include "diblib_alldstbpp.h" +#undef _SOURCE_BPP + +#define _SOURCE_BPP 32 +#include "diblib_alldstbpp.h" +#undef _SOURCE_BPP + +#undef _DibXlate +#define _DibXlate(pBltData, ulColor) (ulColor) +#define _SOURCE_BPP _DEST_BPP +#define _NextPixel_ _NextPixelR2L_ + +#undef __DIB_FUNCTION_NAME +#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_SRCDSTEQ +#include "diblib_alldstbpp.h" + +#undef __DIB_FUNCTION_NAME +#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_SRCDSTEQR2L +#include "diblib_alldstbpp.h" +#undef _SOURCE_BPP + +PFN_DIBFUNCTION +__PASTE(gapfn, __FUNCTIONNAME)[7][7] = +{ + {0, 0, 0, 0, 0, 0}, + { + __DIB_FUNCTION_NAME_SRCDSTEQ(__FUNCTIONNAME, 1, 1), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 1, 1), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 4, 1), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 8, 1), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 16, 1), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 24, 1), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 32, 1), + }, + { + __DIB_FUNCTION_NAME_SRCDSTEQ(__FUNCTIONNAME, 4, 4), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 1, 4), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 4, 4), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 8, 4), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 16, 4), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 24, 4), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 32, 4), + }, + { + __DIB_FUNCTION_NAME_SRCDSTEQ(__FUNCTIONNAME, 8, 8), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 1, 8), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 4, 8), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 8, 8), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 16, 8), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 24, 8), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 32, 8), + }, + { + __DIB_FUNCTION_NAME_SRCDSTEQ(__FUNCTIONNAME, 16, 16), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 1, 16), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 4, 16), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 8, 16), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 16, 16), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 24, 16), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 32, 16), + }, + { + __DIB_FUNCTION_NAME_SRCDSTEQ(__FUNCTIONNAME, 24, 24), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 1, 24), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 4, 24), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 8, 24), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 16, 24), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 24, 24), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 32, 24), + }, + { + __DIB_FUNCTION_NAME_SRCDSTEQ(__FUNCTIONNAME, 32, 32), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 1, 32), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 4, 32), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 8, 32), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 16, 32), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 24, 32), + __DIB_FUNCTION_NAME_SRCDST(__FUNCTIONNAME, 32, 32), + }, +}; + +#undef __DIB_FUNCTION_NAME + diff --git a/reactos/subsystems/win32/win32k/diblib/DibLib_BitBlt.h b/reactos/subsystems/win32/win32k/diblib/DibLib_BitBlt.h new file mode 100644 index 00000000000..ce4f0a40f61 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/DibLib_BitBlt.h @@ -0,0 +1,130 @@ + +#if __USES_SOLID_BRUSH +#undef __USES_PATTERN +#define __USES_PATTERN 0 +#endif + +#define _DibFunction __DIB_FUNCTION_NAME(__FUNCTIONNAME, _SOURCE_BPP, _DEST_BPP) +#define _ReadPixel(bpp, pj, jShift) __PASTE(_ReadPixel_, bpp)(pj, jShift) +#define _WritePixel(pj, jShift, c) __PASTE(_WritePixel_, _DEST_BPP)(pj, jShift, c) +#define _NextPixel(bpp, ppj, pjShift) __PASTE(_NextPixel_, bpp)(ppj, pjShift) +#define _SHIFT(bpp, x) __PASTE(_SHIFT_, bpp)(x) + +VOID +FASTCALL +_DibFunction(PBLTDATA pBltData) +{ + ULONG cRows, cLines, ulDest; + PBYTE pjDest, pjDestBase; + _SHIFT(_DEST_BPP, BYTE jDstShift;) +#if __USES_MASK + PBYTE pjMask, pjMaskBase; + BYTE jMaskBit, jMskShift; +#endif +#if __USES_SOURCE + PBYTE pjSource, pjSrcBase; + ULONG ulSource; + _SHIFT(_SOURCE_BPP, BYTE jSrcShift;) +#endif +#if __USES_PATTERN + PBYTE pjPattern, pjPatBase; + ULONG ulPattern, cPatRows, cPatLines; + _SHIFT(_DEST_BPP, BYTE jPatShift;) +#endif +#if __USES_SOLID_BRUSH + ULONG ulPattern = pBltData->ulSolidColor; +#endif + +#if __USES_MASK + pjMaskBase = pBltData->siMsk.pjBase; +#endif +#if __USES_PATTERN + pjPatBase = pBltData->siPat.pjBase; + pjPatBase += pBltData->siPat.ptOrig.y * pBltData->siPat.lDelta; + pjPattern = pjPatBase + pBltData->siPat.ptOrig.x * _DEST_BPP / 8; + _SHIFT(_DEST_BPP, jPatShift = pBltData->siPat.jShift0;) + cPatLines = pBltData->ulPatHeight - pBltData->siPat.ptOrig.y; + cPatRows = pBltData->ulPatWidth - pBltData->siPat.ptOrig.x; +#endif + pjDestBase = pBltData->siDst.pjBase; +#if __USES_SOURCE + pjSrcBase = pBltData->siSrc.pjBase; +#endif + + /* Loop all lines */ + cLines = pBltData->ulHeight; + while (cLines--) + { + /* Set current bit pointers and shifts */ + pjDest = pjDestBase; + _SHIFT(_DEST_BPP, jDstShift = pBltData->siDst.jShift0;) +#if __USES_SOURCE + pjSource = pjSrcBase; + _SHIFT(_SOURCE_BPP, jSrcShift = pBltData->siSrc.jShift0;) +#endif +#if __USES_MASK + pjMask = pjMaskBase; + jMskShift = pBltData->siMsk.jShift0; +#endif + + /* Loop all rows */ + cRows = pBltData->ulWidth; + while (cRows--) + { +#if __USES_MASK + /* Read the mask color and go to the next mask pixel */ + jMaskBit = _ReadPixel_1(pjMask, jMskShift); + _NextPixel_1(&pjMask, &jMskShift); +#endif +#if __USES_PATTERN + /* Read the pattern color and go to the next pattern pixel */ + ulPattern = _ReadPixel(_DEST_BPP, pjPattern, jPatShift); + _NextPixel(_DEST_BPP, &pjPattern, &jPatShift); + + /* Check if this was the last pixel in the pattern */ + if (--cPatRows == 0) + { + /* Restart pattern from x = 0 */ + pjPattern = pjPatBase; + _SHIFT(_DEST_BPP, jPatShift = (_DEST_BPP == 1) ? 7 : 4;) + cPatRows = pBltData->ulPatWidth; + } +#endif +#if __USES_SOURCE + /* Read the pattern color, xlate it and go to the next pixel */ + ulSource = _ReadPixel(_SOURCE_BPP, pjSource, jSrcShift); + ulSource = _DibXlate(pBltData, ulSource); + _NextPixel(_SOURCE_BPP, &pjSource, &jSrcShift); +#endif +#if __USES_DEST + ulDest = _ReadPixel(_DEST_BPP, pjDest, jDstShift); +#endif + /* Apply the ROP operation on the colors */ + ulDest = _DibDoRop(pBltData, jMaskBit, ulDest, ulSource, ulPattern); + + /* Write the pixel and go to the next dest pixel */ + _WritePixel(pjDest, jDstShift, ulDest); + _NextPixel(_DEST_BPP, &pjDest, &jDstShift); + } + + pjDestBase += pBltData->siDst.lDelta; +#if __USES_SOURCE + pjSrcBase += pBltData->siSrc.lDelta; +#endif +#if __USES_PATTERN + /* Go to the next pattern line */ + pjPatBase += pBltData->siPat.lDelta; + + /* Check if this was the last line in the pattern */ + if (--cPatLines == 0) + { + /* Restart pattern from y = 0 */ + pjPatBase = pBltData->siPat.pjBase; + cPatLines = pBltData->ulPatHeight; + } +#endif + } +} + +#undef _DibFunction +#undef __FUNCTIONNAME2 diff --git a/reactos/subsystems/win32/win32k/diblib/DibLib_interface.h b/reactos/subsystems/win32/win32k/diblib/DibLib_interface.h new file mode 100644 index 00000000000..15988f8a7c6 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/DibLib_interface.h @@ -0,0 +1,66 @@ + +#include "RopFunctions.h" + +typedef +ULONG +(NTAPI *PFN_XLATE)(XLATEOBJ* pxlo, ULONG ulColor); + +typedef struct +{ + ULONG iFormat; + PBYTE pjBase; + LONG lDelta; + POINTL ptOrig; + BYTE jShift0; +} SURFINFO; + +typedef struct +{ + SURFINFO siSrc; + SURFINFO siDst; + SURFINFO siPat; + SURFINFO siMsk; + + ULONG ulWidth; + ULONG ulHeight; + ULONG ulPatWidth; + ULONG ulPatHeight; + XLATEOBJ *pxlo; + PFN_XLATE pfnXlate; + ULONG rop4; + PFN_DOROP apfnDoRop[2]; + ULONG ulSolidColor; +} BLTDATA, *PBLTDATA; + +typedef +VOID +(FASTCALL +*PFN_DIBFUNCTION)(PBLTDATA pBltData); + +VOID FASTCALL Dib_BitBlt_NOOP(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_SOLIDFILL(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_BLACKNESS(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_WHITENESS(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_PATCOPY(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_NOTPATCOPY(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_DSTINVERT(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_SRCCOPY(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_NOTSRCCOPY(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_SRCERASE(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_NOTSRCERASE(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_PATINVERT(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_SRCINVERT(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_SRCAND(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_MERGEPAINT(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_MERGECOPY(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_SRCPAINT(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt_PATPAINT(PBLTDATA pBltData); +VOID FASTCALL Dib_SrcPatBlt(PBLTDATA pBltData); +VOID FASTCALL Dib_PatPaint(PBLTDATA pBltData); +VOID FASTCALL Dib_SrcPaint(PBLTDATA pBltData); +VOID FASTCALL Dib_BitBlt(PBLTDATA pBltData); + + +extern PFN_DIBFUNCTION apfnDibFunction[]; +extern UCHAR aiIndexPerRop[256]; + diff --git a/reactos/subsystems/win32/win32k/diblib/MaskBlt.c b/reactos/subsystems/win32/win32k/diblib/MaskBlt.c new file mode 100644 index 00000000000..1c66b09b389 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/MaskBlt.c @@ -0,0 +1,29 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 1 +#define __USES_DEST 1 +#define __USES_MASK 1 + +#define __FUNCTIONNAME MaskBlt + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[M](D,S,P) + +#include "diblib_allsrcbpp.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME MaskBlt_Solid +#define __USES_SOLID_BRUSH 1 +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_MaskBlt(PBLTDATA pBltData) +{ + gapfnMaskBlt[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + + + + diff --git a/reactos/subsystems/win32/win32k/diblib/MaskCopy.c b/reactos/subsystems/win32/win32k/diblib/MaskCopy.c new file mode 100644 index 00000000000..f98e42eb3c6 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/MaskCopy.c @@ -0,0 +1,35 @@ + +#include "DibLib.h" + +extern PFN_DIBFUNCTION gapfnBitBlt_SRCCOPY[7][7]; +extern PFN_DIBFUNCTION gapfnBitBlt_SRCINVERT[7][7]; + +VOID +FASTCALL +Dib_MaskCopy(PBLTDATA pBltData) +{ + pBltData->siSrc = pBltData->siMsk; + + /* Create an XLATEOBJ */ + pBltData->pxlo = 0;// FIXME: use 1bpp -> destbpp + + /* 4 possibilities... */ + if (pBltData->rop4 == MAKEROP4(BLACKNESS, WHITENESS)) + { + gapfnBitBlt_SRCCOPY[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); + } + else if (pBltData->rop4 == MAKEROP4(WHITENESS, BLACKNESS)) + { + gapfnBitBlt_SRCINVERT[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); + } + else if (pBltData->rop4 == MAKEROP4(BLACKNESS, BLACKNESS)) + { + Dib_BitBlt_BLACKNESS(pBltData); + } + else // if (pBltData->rop4 == MAKEROP4(WHITENESS, WHITENESS)) + { + Dib_BitBlt_WHITENESS(pBltData); + } +} + + diff --git a/reactos/subsystems/win32/win32k/diblib/MaskPaint.c b/reactos/subsystems/win32/win32k/diblib/MaskPaint.c new file mode 100644 index 00000000000..bbd04b9ff3d --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/MaskPaint.c @@ -0,0 +1,25 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 0 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 1 + +#define __FUNCTIONNAME MaskPaint + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[M](D,0,0) + +#include "diblib_alldstbpp.h" + +VOID +FASTCALL +Dib_MaskPaint(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnMaskPaint[pBltData->siDst.iFormat](pBltData); +} + + + + diff --git a/reactos/subsystems/win32/win32k/diblib/MaskPatBlt.c b/reactos/subsystems/win32/win32k/diblib/MaskPatBlt.c new file mode 100644 index 00000000000..887212f91e2 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/MaskPatBlt.c @@ -0,0 +1,26 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 0 +#define __USES_PATTERN 1 +#define __USES_DEST 0 +#define __USES_MASK 1 + +#define __FUNCTIONNAME MaskPatBlt + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[M](0,0,P) + +#include "diblib_alldstbpp.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME MaskPatBlt_Solid +#define __USES_SOLID_BRUSH 1 +#include "diblib_alldstbpp.h" + +VOID +FASTCALL +Dib_MaskPatBlt(PBLTDATA pBltData) +{ + gapfnMaskPatBlt[pBltData->siDst.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/MaskPatPaint.c b/reactos/subsystems/win32/win32k/diblib/MaskPatPaint.c new file mode 100644 index 00000000000..292984d637e --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/MaskPatPaint.c @@ -0,0 +1,38 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 0 +#define __USES_PATTERN 1 +#define __USES_DEST 1 +#define __USES_MASK 1 + +#define __FUNCTIONNAME MaskPatPaint + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[M](D,0,P) + +#include "diblib_alldstbpp.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME MaskPatPaint_Solid +#define __USES_SOLID_BRUSH 1 +#include "diblib_alldstbpp.h" + +VOID +FASTCALL +Dib_MaskPatPaint(PBLTDATA pBltData) +{ + /* Check for solid brush */ + if (pBltData->ulSolidColor != 0xFFFFFFFF) + { + /* Use the solid version of PATCOPY! */ + gapfnMaskPatPaint_Solid[pBltData->siDst.iFormat](pBltData); + } + else + { + /* Use the pattern version */ + gapfnMaskPatPaint[pBltData->siDst.iFormat](pBltData); + } +} + + + diff --git a/reactos/subsystems/win32/win32k/diblib/MaskSrcBlt.c b/reactos/subsystems/win32/win32k/diblib/MaskSrcBlt.c new file mode 100644 index 00000000000..fe992722dc7 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/MaskSrcBlt.c @@ -0,0 +1,23 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 1 + +#define __FUNCTIONNAME MaskSrcBlt + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[M](D,S,0) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_MaskSrcBlt(PBLTDATA pBltData) +{ + gapfnMaskSrcBlt[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + + + diff --git a/reactos/subsystems/win32/win32k/diblib/MaskSrcPaint.c b/reactos/subsystems/win32/win32k/diblib/MaskSrcPaint.c new file mode 100644 index 00000000000..9c3d622dd38 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/MaskSrcPaint.c @@ -0,0 +1,21 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 1 + +#define __FUNCTIONNAME MaskSrcPaint + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[M](D,S,0) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_MaskSrcPaint(PBLTDATA pBltData) +{ + gapfnMaskSrcPaint[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + diff --git a/reactos/subsystems/win32/win32k/diblib/MaskSrcPatBlt.c b/reactos/subsystems/win32/win32k/diblib/MaskSrcPatBlt.c new file mode 100644 index 00000000000..d64774845da --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/MaskSrcPatBlt.c @@ -0,0 +1,27 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 1 +#define __USES_DEST 1 +#define __USES_MASK 1 + +#define __FUNCTIONNAME MaskSrcPatBlt + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[M](D,S,P) + +#include "diblib_allsrcbpp.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME MaskSrcPatBlt_Solid +#define __USES_SOLID_BRUSH 1 +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_MaskSrcPatBlt(PBLTDATA pBltData) +{ + gapfnMaskSrcPatBlt[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + + diff --git a/reactos/subsystems/win32/win32k/diblib/PatPaint.c b/reactos/subsystems/win32/win32k/diblib/PatPaint.c new file mode 100644 index 00000000000..d4fad80ac41 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/PatPaint.c @@ -0,0 +1,38 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 0 +#define __USES_PATTERN 1 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME PatPaint + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[0](D,0,P) + +#include "diblib_alldstbpp.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME PatPaint_Solid +#define __USES_SOLID_BRUSH 1 +#include "diblib_alldstbpp.h" + +VOID +FASTCALL +Dib_PatPaint(PBLTDATA pBltData) +{ + /* Check for solid brush */ + if (pBltData->ulSolidColor != 0xFFFFFFFF) + { + /* Use the solid version of PATCOPY! */ + gapfnPatPaint_Solid[pBltData->siDst.iFormat](pBltData); + } + else + { + /* Use the pattern version */ + gapfnPatPaint[pBltData->siDst.iFormat](pBltData); + } +} + + + diff --git a/reactos/subsystems/win32/win32k/diblib/RopFunctions.c b/reactos/subsystems/win32/win32k/diblib/RopFunctions.c new file mode 100644 index 00000000000..b4d7cf26d2c --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/RopFunctions.c @@ -0,0 +1,1547 @@ + +#include "DibLib.h" + +#define FASTCALL __fastcall + +ULONG FASTCALL DoRop_0(ULONG D, ULONG S, ULONG P) +{ + return ROP_0(D,S,P); +} + +ULONG FASTCALL DoRop_DPSoon(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSoon(D,S,P); +} + +ULONG FASTCALL DoRop_DPSona(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSona(D,S,P); +} + +ULONG FASTCALL DoRop_PSon(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSon(D,S,P); +} + +ULONG FASTCALL DoRop_SDPona(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPona(D,S,P); +} + +ULONG FASTCALL DoRop_DPon(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPon(D,S,P); +} + +ULONG FASTCALL DoRop_PDSxnon(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSxnon(D,S,P); +} + +ULONG FASTCALL DoRop_PDSaon(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSaon(D,S,P); +} + +ULONG FASTCALL DoRop_SDPnaa(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPnaa(D,S,P); +} + +ULONG FASTCALL DoRop_PDSxon(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSxon(D,S,P); +} + +ULONG FASTCALL DoRop_DPna(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPna(D,S,P); +} + +ULONG FASTCALL DoRop_PSDnaon(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDnaon(D,S,P); +} + +ULONG FASTCALL DoRop_SPna(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPna(D,S,P); +} + +ULONG FASTCALL DoRop_PDSnaon(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSnaon(D,S,P); +} + +ULONG FASTCALL DoRop_PDSonon(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSonon(D,S,P); +} + +ULONG FASTCALL DoRop_Pn(ULONG D, ULONG S, ULONG P) +{ + return ROP_Pn(D,S,P); +} + +ULONG FASTCALL DoRop_PDSona(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSona(D,S,P); +} + +ULONG FASTCALL DoRop_DSon(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSon(D,S,P); +} + +ULONG FASTCALL DoRop_SDPxnon(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPxnon(D,S,P); +} + +ULONG FASTCALL DoRop_SDPaon(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPaon(D,S,P); +} + +ULONG FASTCALL DoRop_DPSxnon(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSxnon(D,S,P); +} + +ULONG FASTCALL DoRop_DPSaon(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSaon(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPSanaxx(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPSanaxx(D,S,P); +} + +ULONG FASTCALL DoRop_SSPxDSxaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SSPxDSxaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SPxPDxa(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPxPDxa(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSanaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSanaxn(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPaox(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPaox(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSxaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSxaxn(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPaox(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPaox(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDxaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDxaxn(D,S,P); +} + +ULONG FASTCALL DoRop_PDSox(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSox(D,S,P); +} + +ULONG FASTCALL DoRop_PDSoan(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSoan(D,S,P); +} + +ULONG FASTCALL DoRop_DPSnaa(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSnaa(D,S,P); +} + +ULONG FASTCALL DoRop_SDPxon(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPxon(D,S,P); +} + +ULONG FASTCALL DoRop_DSna(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSna(D,S,P); +} + +ULONG FASTCALL DoRop_SPDnaon(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDnaon(D,S,P); +} + +ULONG FASTCALL DoRop_SPxDSxa(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPxDSxa(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPanaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPanaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSaox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSaox(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSxnox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSxnox(D,S,P); +} + +ULONG FASTCALL DoRop_DPSxa(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSxa(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPSaoxxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPSaoxxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSana(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSana(D,S,P); +} + +ULONG FASTCALL DoRop_SSPxPDxaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SSPxPDxaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSoax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSoax(D,S,P); +} + +ULONG FASTCALL DoRop_PSDnox(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDnox(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPxox(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPxox(D,S,P); +} + +ULONG FASTCALL DoRop_PSDnoan(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDnoan(D,S,P); +} + +ULONG FASTCALL DoRop_PSna(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSna(D,S,P); +} + +ULONG FASTCALL DoRop_SDPnaon(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPnaon(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSoox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSoox(D,S,P); +} + +ULONG FASTCALL DoRop_Sn(ULONG D, ULONG S, ULONG P) +{ + return ROP_Sn(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSaox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSaox(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSxnox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSxnox(D,S,P); +} + +ULONG FASTCALL DoRop_SDPox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPox(D,S,P); +} + +ULONG FASTCALL DoRop_SDPoan(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPoan(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPoax(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPoax(D,S,P); +} + +ULONG FASTCALL DoRop_SPDnox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDnox(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSxox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSxox(D,S,P); +} + +ULONG FASTCALL DoRop_SPDnoan(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDnoan(D,S,P); +} + +ULONG FASTCALL DoRop_PSx(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSx(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSonox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSonox(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSnaox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSnaox(D,S,P); +} + +ULONG FASTCALL DoRop_PSan(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSan(D,S,P); +} + +ULONG FASTCALL DoRop_PSDnaa(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDnaa(D,S,P); +} + +ULONG FASTCALL DoRop_DPSxon(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSxon(D,S,P); +} + +ULONG FASTCALL DoRop_SDxPDxa(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDxPDxa(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSanaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSanaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDna(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDna(D,S,P); +} + +ULONG FASTCALL DoRop_DPSnaon(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSnaon(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDaox(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDaox(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPxaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPxaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPxa(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPxa(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPDaoxxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPDaoxxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDoax(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDoax(D,S,P); +} + +ULONG FASTCALL DoRop_PDSnox(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSnox(D,S,P); +} + +ULONG FASTCALL DoRop_SDPana(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPana(D,S,P); +} + +ULONG FASTCALL DoRop_SSPxDSxoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SSPxDSxoxn(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPxox(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPxox(D,S,P); +} + +ULONG FASTCALL DoRop_PDSnoan(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSnoan(D,S,P); +} + +ULONG FASTCALL DoRop_PDna(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDna(D,S,P); +} + +ULONG FASTCALL DoRop_DSPnaon(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPnaon(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDaox(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDaox(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSxaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSxaxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSonon(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSonon(D,S,P); +} + +ULONG FASTCALL DoRop_Dn(ULONG D, ULONG S, ULONG P) +{ + return ROP_Dn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSox(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSox(D,S,P); +} + +ULONG FASTCALL DoRop_DPSoan(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSoan(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPoax(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPoax(D,S,P); +} + +ULONG FASTCALL DoRop_DPSnox(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSnox(D,S,P); +} + +ULONG FASTCALL DoRop_DPx(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPx(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDonox(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDonox(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDxox(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDxox(D,S,P); +} + +ULONG FASTCALL DoRop_DPSnoan(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSnoan(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDnaox(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDnaox(D,S,P); +} + +ULONG FASTCALL DoRop_DPan(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPan(D,S,P); +} + +ULONG FASTCALL DoRop_PDSxa(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSxa(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDSaoxxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDSaoxxn(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDoax(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDoax(D,S,P); +} + +ULONG FASTCALL DoRop_SDPnox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPnox(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSoax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSoax(D,S,P); +} + +ULONG FASTCALL DoRop_DSPnox(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPnox(D,S,P); +} + +ULONG FASTCALL DoRop_DSx(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSx(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSonox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSonox(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDSonoxxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDSonoxxn(D,S,P); +} + +ULONG FASTCALL DoRop_PDSxxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSxxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSax(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSax(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPSoaxxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPSoaxxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPax(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPDoaxxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPDoaxxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSnoax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSnoax(D,S,P); +} + +ULONG FASTCALL DoRop_PDSxnan(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSxnan(D,S,P); +} + +ULONG FASTCALL DoRop_PDSana(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSana(D,S,P); +} + +ULONG FASTCALL DoRop_SSDxPDxaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SSDxPDxaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSxox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSxox(D,S,P); +} + +ULONG FASTCALL DoRop_SDPnoan(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPnoan(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDxox(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDxox(D,S,P); +} + +ULONG FASTCALL DoRop_DSPnoan(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPnoan(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSnaox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSnaox(D,S,P); +} + +ULONG FASTCALL DoRop_DSan(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSan(D,S,P); +} + +ULONG FASTCALL DoRop_PDSax(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSax(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDSoaxxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDSoaxxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDnoax(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDnoax(D,S,P); +} + +ULONG FASTCALL DoRop_SDPxnan(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPxnan(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSnoax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSnoax(D,S,P); +} + +ULONG FASTCALL DoRop_DPSxnan(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSxnan(D,S,P); +} + +ULONG FASTCALL DoRop_SPxDSxo(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPxDSxo(D,S,P); +} + +ULONG FASTCALL DoRop_DPSaan(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSaan(D,S,P); +} + +ULONG FASTCALL DoRop_DPSaa(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSaa(D,S,P); +} + +ULONG FASTCALL DoRop_SPxDSxon(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPxDSxon(D,S,P); +} + +ULONG FASTCALL DoRop_DPSxna(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSxna(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSnoaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSnoaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPxna(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPxna(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPnoaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPnoaxn(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDSoaxx(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDSoaxx(D,S,P); +} + +ULONG FASTCALL DoRop_PDSaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSaxn(D,S,P); +} + +ULONG FASTCALL DoRop_DSa(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSa(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSnaoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSnaoxn(D,S,P); +} + +ULONG FASTCALL DoRop_DSPnoa(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPnoa(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDxoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDxoxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPnoa(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPnoa(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSxoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSxoxn(D,S,P); +} + +ULONG FASTCALL DoRop_SSDxPDxax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SSDxPDxax(D,S,P); +} + +ULONG FASTCALL DoRop_PDSanan(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSanan(D,S,P); +} + +ULONG FASTCALL DoRop_PDSxna(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSxna(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSnoaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSnoaxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDPoaxx(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDPoaxx(D,S,P); +} + +ULONG FASTCALL DoRop_SPDaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDaxn(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPSoaxx(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPSoaxx(D,S,P); +} + +ULONG FASTCALL DoRop_DPSaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSaxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSxx(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSxx(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPSonoxx(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPSonoxx(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSonoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSonoxn(D,S,P); +} + +ULONG FASTCALL DoRop_DSxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSnax(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSnax(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSoaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSoaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SPDnax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDnax(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDoaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDoaxn(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDSaoxx(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDSaoxx(D,S,P); +} + +ULONG FASTCALL DoRop_PDSxan(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSxan(D,S,P); +} + +ULONG FASTCALL DoRop_DPa(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPa(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPnaoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPnaoxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSnoa(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSnoa(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDxoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDxoxn(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPonoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPonoxn(D,S,P); +} + +ULONG FASTCALL DoRop_PDxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDxn(D,S,P); +} + +ULONG FASTCALL DoRop_DSPnax(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPnax(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPoaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPoaxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSoa(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSoa(D,S,P); +} + +ULONG FASTCALL DoRop_DPSoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSoxn(D,S,P); +} + +ULONG FASTCALL DoRop_D(ULONG D, ULONG S, ULONG P) +{ + return ROP_D(D,S,P); +} + +ULONG FASTCALL DoRop_DPSono(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSono(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSxax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSxax(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDaoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDaoxn(D,S,P); +} + +ULONG FASTCALL DoRop_DSPnao(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPnao(D,S,P); +} + +ULONG FASTCALL DoRop_DPno(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPno(D,S,P); +} + +ULONG FASTCALL DoRop_PDSnoa(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSnoa(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPxoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPxoxn(D,S,P); +} + +ULONG FASTCALL DoRop_SSPxDSxox(ULONG D, ULONG S, ULONG P) +{ + return ROP_SSPxDSxox(D,S,P); +} + +ULONG FASTCALL DoRop_SDPanan(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPanan(D,S,P); +} + +ULONG FASTCALL DoRop_PSDnax(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDnax(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDoaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDoaxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDPaoxx(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDPaoxx(D,S,P); +} + +ULONG FASTCALL DoRop_SDPxan(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPxan(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPxax(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPxax(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDaoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDaoxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSnao(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSnao(D,S,P); +} + +ULONG FASTCALL DoRop_DSno(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSno(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSanax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSanax(D,S,P); +} + +ULONG FASTCALL DoRop_SDxPDxan(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDxPDxan(D,S,P); +} + +ULONG FASTCALL DoRop_DPSxo(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSxo(D,S,P); +} + +ULONG FASTCALL DoRop_DPSano(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSano(D,S,P); +} + +ULONG FASTCALL DoRop_PSa(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSa(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSnaoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSnaox(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSonoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSonoxn(D,S,P); +} + +ULONG FASTCALL DoRop_PSxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSxn(D,S,P); +} + +ULONG FASTCALL DoRop_SPDnoa(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDnoa(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSxoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSxoxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPnax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPnax(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPoaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPoaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPoa(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPoa(D,S,P); +} + +ULONG FASTCALL DoRop_SPDoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDoxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDxax(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDxax(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSaoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSaoxn(D,S,P); +} + +ULONG FASTCALL DoRop_S(ULONG D, ULONG S, ULONG P) +{ + return ROP_S(D,S,P); +} + +ULONG FASTCALL DoRop_SDPono(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPono(D,S,P); +} + +ULONG FASTCALL DoRop_SDPnao(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPnao(D,S,P); +} + +ULONG FASTCALL DoRop_SPno(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPno(D,S,P); +} + +ULONG FASTCALL DoRop_PSDnoa(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDnoa(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPxoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPxoxn(D,S,P); +} + +ULONG FASTCALL DoRop_PDSnax(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSnax(D,S,P); +} + +ULONG FASTCALL DoRop_SPDSoaxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDSoaxn(D,S,P); +} + +ULONG FASTCALL DoRop_SSPxPDxax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SSPxPDxax(D,S,P); +} + +ULONG FASTCALL DoRop_DPSanan(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSanan(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPSaoxx(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPSaoxx(D,S,P); +} + +ULONG FASTCALL DoRop_DPSxan(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSxan(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPxax(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPxax(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSaoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSaoxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSDanax(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSDanax(D,S,P); +} + +ULONG FASTCALL DoRop_SPxDSxan(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPxDSxan(D,S,P); +} + +ULONG FASTCALL DoRop_SPDnao(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPDnao(D,S,P); +} + +ULONG FASTCALL DoRop_SDno(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDno(D,S,P); +} + +ULONG FASTCALL DoRop_SDPxo(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPxo(D,S,P); +} + +ULONG FASTCALL DoRop_SDPano(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPano(D,S,P); +} + +ULONG FASTCALL DoRop_PDSoa(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSoa(D,S,P); +} + +ULONG FASTCALL DoRop_PDSoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSoxn(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDxax(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDxax(D,S,P); +} + +ULONG FASTCALL DoRop_PSDPaoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDPaoxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSxax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSxax(D,S,P); +} + +ULONG FASTCALL DoRop_PDSPaoxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSPaoxn(D,S,P); +} + +ULONG FASTCALL DoRop_SDPSanax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPSanax(D,S,P); +} + +ULONG FASTCALL DoRop_SPxPDxan(ULONG D, ULONG S, ULONG P) +{ + return ROP_SPxPDxan(D,S,P); +} + +ULONG FASTCALL DoRop_SSPxDSxax(ULONG D, ULONG S, ULONG P) +{ + return ROP_SSPxDSxax(D,S,P); +} + +ULONG FASTCALL DoRop_DSPDSanaxxn(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSPDSanaxxn(D,S,P); +} + +ULONG FASTCALL DoRop_DPSao(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSao(D,S,P); +} + +ULONG FASTCALL DoRop_DPSxno(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSxno(D,S,P); +} + +ULONG FASTCALL DoRop_SDPao(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPao(D,S,P); +} + +ULONG FASTCALL DoRop_SDPxno(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPxno(D,S,P); +} + +ULONG FASTCALL DoRop_DSo(ULONG D, ULONG S, ULONG P) +{ + return ROP_DSo(D,S,P); +} + +ULONG FASTCALL DoRop_SDPnoo(ULONG D, ULONG S, ULONG P) +{ + return ROP_SDPnoo(D,S,P); +} + +ULONG FASTCALL DoRop_P(ULONG D, ULONG S, ULONG P) +{ + return ROP_P(D,S,P); +} + +ULONG FASTCALL DoRop_PDSono(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSono(D,S,P); +} + +ULONG FASTCALL DoRop_PDSnao(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSnao(D,S,P); +} + +ULONG FASTCALL DoRop_PSno(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSno(D,S,P); +} + +ULONG FASTCALL DoRop_PSDnao(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDnao(D,S,P); +} + +ULONG FASTCALL DoRop_PDno(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDno(D,S,P); +} + +ULONG FASTCALL DoRop_PDSxo(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSxo(D,S,P); +} + +ULONG FASTCALL DoRop_PDSano(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSano(D,S,P); +} + +ULONG FASTCALL DoRop_PDSao(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSao(D,S,P); +} + +ULONG FASTCALL DoRop_PDSxno(ULONG D, ULONG S, ULONG P) +{ + return ROP_PDSxno(D,S,P); +} + +ULONG FASTCALL DoRop_DPo(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPo(D,S,P); +} + +ULONG FASTCALL DoRop_DPSnoo(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSnoo(D,S,P); +} + +ULONG FASTCALL DoRop_PSo(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSo(D,S,P); +} + +ULONG FASTCALL DoRop_PSDnoo(ULONG D, ULONG S, ULONG P) +{ + return ROP_PSDnoo(D,S,P); +} + +ULONG FASTCALL DoRop_DPSoo(ULONG D, ULONG S, ULONG P) +{ + return ROP_DPSoo(D,S,P); +} + +ULONG FASTCALL DoRop_1(ULONG D, ULONG S, ULONG P) +{ + return ROP_1(D,S,P); +} + +PFN_DOROP +gapfnRop[256] = +{ + DoRop_0, // BLACKNESS + DoRop_DPSoon, + DoRop_DPSona, + DoRop_PSon, + DoRop_SDPona, + DoRop_DPon, + DoRop_PDSxnon, + DoRop_PDSaon, + DoRop_SDPnaa, + DoRop_PDSxon, + DoRop_DPna, + DoRop_PSDnaon, + DoRop_SPna, + DoRop_PDSnaon, + DoRop_PDSonon, + DoRop_Pn, + DoRop_PDSona, + DoRop_DSon, // NOTSRCERASE + DoRop_SDPxnon, + DoRop_SDPaon, + DoRop_DPSxnon, + DoRop_DPSaon, + DoRop_PSDPSanaxx, + DoRop_SSPxDSxaxn, + DoRop_SPxPDxa, + DoRop_SDPSanaxn, + DoRop_PDSPaox, + DoRop_SDPSxaxn, + DoRop_PSDPaox, + DoRop_DSPDxaxn, + DoRop_PDSox, + DoRop_PDSoan, + DoRop_DPSnaa, + DoRop_SDPxon, + DoRop_DSna, + DoRop_SPDnaon, + DoRop_SPxDSxa, + DoRop_PDSPanaxn, + DoRop_SDPSaox, + DoRop_SDPSxnox, + DoRop_DPSxa, + DoRop_PSDPSaoxxn, + DoRop_DPSana, + DoRop_SSPxPDxaxn, + DoRop_SPDSoax, + DoRop_PSDnox, + DoRop_PSDPxox, + DoRop_PSDnoan, + DoRop_PSna, + DoRop_SDPnaon, + DoRop_SDPSoox, + DoRop_Sn, // NOTSRCCOPY + DoRop_SPDSaox, + DoRop_SPDSxnox, + DoRop_SDPox, + DoRop_SDPoan, + DoRop_PSDPoax, + DoRop_SPDnox, + DoRop_SPDSxox, + DoRop_SPDnoan, + DoRop_PSx, + DoRop_SPDSonox, + DoRop_SPDSnaox, + DoRop_PSan, + DoRop_PSDnaa, + DoRop_DPSxon, + DoRop_SDxPDxa, + DoRop_SPDSanaxn, + DoRop_SDna, // SRCERASE + DoRop_DPSnaon, + DoRop_DSPDaox, + DoRop_PSDPxaxn, + DoRop_SDPxa, + DoRop_PDSPDaoxxn, + DoRop_DPSDoax, + DoRop_PDSnox, + DoRop_SDPana, + DoRop_SSPxDSxoxn, + DoRop_PDSPxox, + DoRop_PDSnoan, + DoRop_PDna, + DoRop_DSPnaon, + DoRop_DPSDaox, + DoRop_SPDSxaxn, + DoRop_DPSonon, + DoRop_Dn, // DSTINVERT + DoRop_DPSox, + DoRop_DPSoan, + DoRop_PDSPoax, + DoRop_DPSnox, + DoRop_DPx, // PATINVERT + DoRop_DPSDonox, + DoRop_DPSDxox, + DoRop_DPSnoan, + DoRop_DPSDnaox, + DoRop_DPan, + DoRop_PDSxa, + DoRop_DSPDSaoxxn, + DoRop_DSPDoax, + DoRop_SDPnox, + DoRop_SDPSoax, + DoRop_DSPnox, + DoRop_DSx, // SRCINVERT + DoRop_SDPSonox, + DoRop_DSPDSonoxxn, + DoRop_PDSxxn, + DoRop_DPSax, + DoRop_PSDPSoaxxn, + DoRop_SDPax, + DoRop_PDSPDoaxxn, + DoRop_SDPSnoax, + DoRop_PDSxnan, + DoRop_PDSana, + DoRop_SSDxPDxaxn, + DoRop_SDPSxox, + DoRop_SDPnoan, + DoRop_DSPDxox, + DoRop_DSPnoan, + DoRop_SDPSnaox, + DoRop_DSan, + DoRop_PDSax, + DoRop_DSPDSoaxxn, + DoRop_DPSDnoax, + DoRop_SDPxnan, + DoRop_SPDSnoax, + DoRop_DPSxnan, + DoRop_SPxDSxo, + DoRop_DPSaan, + DoRop_DPSaa, + DoRop_SPxDSxon, + DoRop_DPSxna, + DoRop_SPDSnoaxn, + DoRop_SDPxna, + DoRop_PDSPnoaxn, + DoRop_DSPDSoaxx, + DoRop_PDSaxn, + DoRop_DSa, // SRCAND + DoRop_SDPSnaoxn, + DoRop_DSPnoa, + DoRop_DSPDxoxn, + DoRop_SDPnoa, + DoRop_SDPSxoxn, + DoRop_SSDxPDxax, + DoRop_PDSanan, + DoRop_PDSxna, + DoRop_SDPSnoaxn, + DoRop_DPSDPoaxx, + DoRop_SPDaxn, + DoRop_PSDPSoaxx, + DoRop_DPSaxn, + DoRop_DPSxx, + DoRop_PSDPSonoxx, + DoRop_SDPSonoxn, + DoRop_DSxn, + DoRop_DPSnax, + DoRop_SDPSoaxn, + DoRop_SPDnax, + DoRop_DSPDoaxn, + DoRop_DSPDSaoxx, + DoRop_PDSxan, + DoRop_DPa, + DoRop_PDSPnaoxn, + DoRop_DPSnoa, + DoRop_DPSDxoxn, + DoRop_PDSPonoxn, + DoRop_PDxn, + DoRop_DSPnax, + DoRop_PDSPoaxn, + DoRop_DPSoa, + DoRop_DPSoxn, + DoRop_D, + DoRop_DPSono, + DoRop_SPDSxax, + DoRop_DPSDaoxn, + DoRop_DSPnao, + DoRop_DPno, + DoRop_PDSnoa, + DoRop_PDSPxoxn, + DoRop_SSPxDSxox, + DoRop_SDPanan, + DoRop_PSDnax, + DoRop_DPSDoaxn, + DoRop_DPSDPaoxx, + DoRop_SDPxan, + DoRop_PSDPxax, + DoRop_DSPDaoxn, + DoRop_DPSnao, + DoRop_DSno, // MERGEPAINT + DoRop_SPDSanax, + DoRop_SDxPDxan, + DoRop_DPSxo, + DoRop_DPSano, + DoRop_PSa, // MERGECOPY + DoRop_SPDSnaoxn, + DoRop_SPDSonoxn, + DoRop_PSxn, + DoRop_SPDnoa, + DoRop_SPDSxoxn, + DoRop_SDPnax, + DoRop_PSDPoaxn, + DoRop_SDPoa, + DoRop_SPDoxn, + DoRop_DPSDxax, + DoRop_SPDSaoxn, + DoRop_S, // SRCCOPY + DoRop_SDPono, + DoRop_SDPnao, + DoRop_SPno, + DoRop_PSDnoa, + DoRop_PSDPxoxn, + DoRop_PDSnax, + DoRop_SPDSoaxn, + DoRop_SSPxPDxax, + DoRop_DPSanan, + DoRop_PSDPSaoxx, + DoRop_DPSxan, + DoRop_PDSPxax, + DoRop_SDPSaoxn, + DoRop_DPSDanax, + DoRop_SPxDSxan, + DoRop_SPDnao, + DoRop_SDno, + DoRop_SDPxo, + DoRop_SDPano, + DoRop_PDSoa, + DoRop_PDSoxn, + DoRop_DSPDxax, + DoRop_PSDPaoxn, + DoRop_SDPSxax, + DoRop_PDSPaoxn, + DoRop_SDPSanax, + DoRop_SPxPDxan, + DoRop_SSPxDSxax, + DoRop_DSPDSanaxxn, + DoRop_DPSao, + DoRop_DPSxno, + DoRop_SDPao, + DoRop_SDPxno, + DoRop_DSo, // SRCPAINT + DoRop_SDPnoo, + DoRop_P, // PATCOPY + DoRop_PDSono, + DoRop_PDSnao, + DoRop_PSno, + DoRop_PSDnao, + DoRop_PDno, + DoRop_PDSxo, + DoRop_PDSano, + DoRop_PDSao, + DoRop_PDSxno, + DoRop_DPo, + DoRop_DPSnoo, // PATPAINT + DoRop_PSo, + DoRop_PSDnoo, + DoRop_DPSoo, + DoRop_1 //WHITENESS +}; + + diff --git a/reactos/subsystems/win32/win32k/diblib/RopFunctions.h b/reactos/subsystems/win32/win32k/diblib/RopFunctions.h new file mode 100644 index 00000000000..c1afc7ea972 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/RopFunctions.h @@ -0,0 +1,282 @@ + +typedef +ULONG +(__fastcall +*PFN_DOROP)(ULONG D, ULONG S, ULONG P); + +PFN_DOROP gapfnRop[256]; + +#define ROP_0(D,S,P) 0 /* BLACKNESS */ +#define ROP_DPSoon(D,S,P) (~((D)|((P)|(S)))) +#define ROP_DPSona(D,S,P) ((D)&(~((P)|(S)))) +#define ROP_PSon(D,S,P) (~((P)|(S))) +#define ROP_SDPona(D,S,P) ((S)&(~((D)|(P)))) +#define ROP_DPon(D,S,P) (~((D)|(P))) +#define ROP_PDSxnon(D,S,P) (~((P)|(~((D)^(S))))) +#define ROP_PDSaon(D,S,P) (~((P)|((D)&(S)))) +#define ROP_SDPnaa(D,S,P) ((S)&((D)&(~(P)))) +#define ROP_PDSxon(D,S,P) (~((P)|((D)^(S)))) +#define ROP_DPna(D,S,P) ((D)&(~(P))) +#define ROP_PSDnaon(D,S,P) (~((P)|((S)&(~(D))))) +#define ROP_SPna(D,S,P) ((S)&(~(P))) +#define ROP_PDSnaon(D,S,P) (~((P)|((D)&(~(S))))) +#define ROP_PDSonon(D,S,P) (~((P)|(~((D)|(S))))) +#define ROP_Pn(D,S,P) (~(P)) +#define ROP_PDSona(D,S,P) ((P)&(~((D)|(S)))) +#define ROP_DSon(D,S,P) (~((D)|(S))) /* NOTSRCERASE */ +#define ROP_SDPxnon(D,S,P) (~((S)|(~((D)^(P))))) +#define ROP_SDPaon(D,S,P) (~((S)|((D)&(P)))) +#define ROP_DPSxnon(D,S,P) (~((D)|(~((P)^(S))))) +#define ROP_DPSaon(D,S,P) (~((D)|((P)&(S)))) +#define ROP_PSDPSanaxx(D,S,P) ((P)^((S)^((D)&(~((P)&(S)))))) +#define ROP_SSPxDSxaxn(D,S,P) (~((S)^(((S)^(P))&((D)^(S))))) +#define ROP_SPxPDxa(D,S,P) (((S)^(P))&((P)^(D))) +#define ROP_SDPSanaxn(D,S,P) (~((S)^((D)&(~((P)&(S)))))) +#define ROP_PDSPaox(D,S,P) ((P)^((D)|((S)&(P)))) +#define ROP_SDPSxaxn(D,S,P) (~((S)^((D)&((P)^(S))))) +#define ROP_PSDPaox(D,S,P) ((P)^((S)|((D)&(P)))) +#define ROP_DSPDxaxn(D,S,P) (~((D)^((S)&((P)^(D))))) +#define ROP_PDSox(D,S,P) ((P)^((D)|(S))) +#define ROP_PDSoan(D,S,P) (~((P)&((D)|(S)))) +#define ROP_DPSnaa(D,S,P) ((D)&((P)&(~(S)))) +#define ROP_SDPxon(D,S,P) (~((S)|((D)^(P)))) +#define ROP_DSna(D,S,P) ((D)&(~(S))) +#define ROP_SPDnaon(D,S,P) (~((S)|((P)&(~(D))))) +#define ROP_SPxDSxa(D,S,P) (((S)^(P))&((D)^(S))) +#define ROP_PDSPanaxn(D,S,P) (~((P)^((D)&(~((S)&(P)))))) +#define ROP_SDPSaox(D,S,P) ((S)^((D)|((P)&(S)))) +#define ROP_SDPSxnox(D,S,P) ((S)^((D)|(~((P)^(S))))) +#define ROP_DPSxa(D,S,P) ((D)&((P)^(S))) +#define ROP_PSDPSaoxxn(D,S,P) (~((P)^((S)^((D)|((P)&(S)))))) +#define ROP_DPSana(D,S,P) ((D)&(~((P)&(S)))) +#define ROP_SSPxPDxaxn(D,S,P) (~((S)^(((S)^(P))&((P)^(D))))) +#define ROP_SPDSoax(D,S,P) ((S)^((P)&((D)|(S)))) +#define ROP_PSDnox(D,S,P) ((P)^((S)|(~(D)))) +#define ROP_PSDPxox(D,S,P) ((P)^((S)|((D)^(P)))) +#define ROP_PSDnoan(D,S,P) (~((P)&((S)|(~(D))))) +#define ROP_PSna(D,S,P) ((P)&(~(S))) +#define ROP_SDPnaon(D,S,P) (~((S)|((D)&(~(P))))) +#define ROP_SDPSoox(D,S,P) ((S)^((D)|((P)|(S)))) +#define ROP_Sn(D,S,P) (~(S)) /* NOTSRCCOPY */ +#define ROP_SPDSaox(D,S,P) ((S)^((P)|((D)&(S)))) +#define ROP_SPDSxnox(D,S,P) ((S)^((P)|(~((D)^(S))))) +#define ROP_SDPox(D,S,P) ((S)^((D)|(P))) +#define ROP_SDPoan(D,S,P) (~((S)&((D)|(P)))) +#define ROP_PSDPoax(D,S,P) ((P)^((S)&((D)|(P)))) +#define ROP_SPDnox(D,S,P) ((S)^((P)|(~(D)))) +#define ROP_SPDSxox(D,S,P) ((S)^((P)|((D)^(S)))) +#define ROP_SPDnoan(D,S,P) (~((S)&((P)|(~(D))))) +#define ROP_PSx(D,S,P) ((P)^(S)) +#define ROP_SPDSonox(D,S,P) ((S)^((P)|(~((D)|(S))))) +#define ROP_SPDSnaox(D,S,P) ((S)^((P)|((D)&(~(S))))) +#define ROP_PSan(D,S,P) (~((P)&(S))) +#define ROP_PSDnaa(D,S,P) ((P)&((S)&(~(D)))) +#define ROP_DPSxon(D,S,P) (~((D)|((P)^(S)))) +#define ROP_SDxPDxa(D,S,P) (((S)^(D))&((P)^(D))) +#define ROP_SPDSanaxn(D,S,P) (~((S)^((P)&(~((D)&(S)))))) +#define ROP_SDna(D,S,P) ((S)&(~(D))) /* SRCERASE */ +#define ROP_DPSnaon(D,S,P) (~((D)|((P)&(~(S))))) +#define ROP_DSPDaox(D,S,P) ((D)^((S)|((P)&(D)))) +#define ROP_PSDPxaxn(D,S,P) (~((P)^((S)&((D)^(P))))) +#define ROP_SDPxa(D,S,P) ((S)&((D)^(P))) +#define ROP_PDSPDaoxxn(D,S,P) (~((P)^((D)^((S)|((P)&(D)))))) +#define ROP_DPSDoax(D,S,P) ((D)^((P)&((S)|(D)))) +#define ROP_PDSnox(D,S,P) ((P)^((D)|(~(S)))) +#define ROP_SDPana(D,S,P) ((S)&(~((D)&(P)))) +#define ROP_SSPxDSxoxn(D,S,P) (~((S)^(((S)^(P))|((D)^(S))))) +#define ROP_PDSPxox(D,S,P) ((P)^((D)|((S)^(P)))) +#define ROP_PDSnoan(D,S,P) (~((P)&((D)|(~(S))))) +#define ROP_PDna(D,S,P) ((P)&(~(D))) +#define ROP_DSPnaon(D,S,P) (~((D)|((S)&(~(P))))) +#define ROP_DPSDaox(D,S,P) ((D)^((P)|((S)&(D)))) +#define ROP_SPDSxaxn(D,S,P) (~((S)^((P)&((D)^(S))))) +#define ROP_DPSonon(D,S,P) (~((D)|(~((P)|(S))))) +#define ROP_Dn(D,S,P) (~(D)) /* DSTINVERT */ +#define ROP_DPSox(D,S,P) ((D)^((P)|(S))) +#define ROP_DPSoan(D,S,P) (~((D)&((P)|(S)))) +#define ROP_PDSPoax(D,S,P) ((P)^((D)&((S)|(P)))) +#define ROP_DPSnox(D,S,P) ((D)^((P)|(~(S)))) +#define ROP_DPx(D,S,P) ((D)^(P)) /* PATINVERT */ +#define ROP_DPSDonox(D,S,P) ((D)^((P)|(~((S)|(D))))) +#define ROP_DPSDxox(D,S,P) ((D)^((P)|((S)^(D)))) +#define ROP_DPSnoan(D,S,P) (~((D)&((P)|(~(S))))) +#define ROP_DPSDnaox(D,S,P) ((D)^((P)|((S)&(~(D))))) +#define ROP_DPan(D,S,P) (~((D)&(P))) +#define ROP_PDSxa(D,S,P) ((P)&((D)^(S))) +#define ROP_DSPDSaoxxn(D,S,P) (~((D)^((S)^((P)|((D)&(S)))))) +#define ROP_DSPDoax(D,S,P) ((D)^((S)&((P)|(D)))) +#define ROP_SDPnox(D,S,P) ((S)^((D)|(~(P)))) +#define ROP_SDPSoax(D,S,P) ((S)^((D)&((P)|(S)))) +#define ROP_DSPnox(D,S,P) ((D)^((S)|(~(P)))) +#define ROP_DSx(D,S,P) ((D)^(S)) /* SRCINVERT */ +#define ROP_SDPSonox(D,S,P) ((S)^((D)|(~((P)|(S))))) +#define ROP_DSPDSonoxxn(D,S,P) (~((D)^((S)^((P)|(~((D)|(S))))))) +#define ROP_PDSxxn(D,S,P) (~((P)^((D)^(S)))) +#define ROP_DPSax(D,S,P) ((D)^((P)&(S))) +#define ROP_PSDPSoaxxn(D,S,P) (~((P)^((S)^((D)&((P)|(S)))))) +#define ROP_SDPax(D,S,P) ((S)^((D)&(P))) +#define ROP_PDSPDoaxxn(D,S,P) (~((P)^((D)^((S)&((P)|(D)))))) +#define ROP_SDPSnoax(D,S,P) ((S)^((D)&((P)|(~(S))))) +#define ROP_PDSxnan(D,S,P) (~((P)&(~((D)^(S))))) +#define ROP_PDSana(D,S,P) ((P)&(~((D)&(S)))) +#define ROP_SSDxPDxaxn(D,S,P) (~((S)^(((S)^(D))&((P)^(D))))) +#define ROP_SDPSxox(D,S,P) ((S)^((D)|((P)^(S)))) +#define ROP_SDPnoan(D,S,P) (~((S)&((D)|(~(P))))) +#define ROP_DSPDxox(D,S,P) ((D)^((S)|((P)^(D)))) +#define ROP_DSPnoan(D,S,P) (~((D)&((S)|(~(P))))) +#define ROP_SDPSnaox(D,S,P) ((S)^((D)|((P)&(~(S))))) +#define ROP_DSan(D,S,P) (~((D)&(S))) +#define ROP_PDSax(D,S,P) ((P)^((D)&(S))) +#define ROP_DSPDSoaxxn(D,S,P) (~((D)^((S)^((P)&((D)|(S)))))) +#define ROP_DPSDnoax(D,S,P) ((D)^((P)&((S)|(~(D))))) +#define ROP_SDPxnan(D,S,P) (~((S)&(~((D)^(P))))) +#define ROP_SPDSnoax(D,S,P) ((S)^((P)&((D)|(~(S))))) +#define ROP_DPSxnan(D,S,P) (~((D)&(~((P)^(S))))) +#define ROP_SPxDSxo(D,S,P) (((S)^(P))|((D)^(S))) +#define ROP_DPSaan(D,S,P) (~((D)&((P)&(S)))) +#define ROP_DPSaa(D,S,P) ((D)&((P)&(S))) +#define ROP_SPxDSxon(D,S,P) (~(((S)^(P))|((D)^(S)))) +#define ROP_DPSxna(D,S,P) ((D)&(~((P)^(S)))) +#define ROP_SPDSnoaxn(D,S,P) (~((S)^((P)&((D)|(~(S)))))) +#define ROP_SDPxna(D,S,P) ((S)&(~((D)^(P)))) +#define ROP_PDSPnoaxn(D,S,P) (~((P)^((D)&((S)|(~(P)))))) +#define ROP_DSPDSoaxx(D,S,P) ((D)^((S)^((P)&((D)|(S))))) +#define ROP_PDSaxn(D,S,P) (~((P)^((D)&(S)))) +#define ROP_DSa(D,S,P) ((D)&(S)) /* SRCAND */ +#define ROP_SDPSnaoxn(D,S,P) (~((S)^((D)|((P)&(~(S)))))) +#define ROP_DSPnoa(D,S,P) ((D)&((S)|(~(P)))) +#define ROP_DSPDxoxn(D,S,P) (~((D)^((S)|((P)^(D))))) +#define ROP_SDPnoa(D,S,P) ((S)&((D)|(~(P)))) +#define ROP_SDPSxoxn(D,S,P) (~((S)^((D)|((P)^(S))))) +#define ROP_SSDxPDxax(D,S,P) ((S)^(((S)^(D))&((P)^(D)))) +#define ROP_PDSanan(D,S,P) (~((P)&(~((D)&(S))))) +#define ROP_PDSxna(D,S,P) ((P)&(~((D)^(S)))) +#define ROP_SDPSnoaxn(D,S,P) (~((S)^((D)&((P)|(~(S)))))) +#define ROP_DPSDPoaxx(D,S,P) ((D)^((P)^((S)&((D)|(P))))) +#define ROP_SPDaxn(D,S,P) (~((S)^((P)&(D)))) +#define ROP_PSDPSoaxx(D,S,P) ((P)^((S)^((D)&((P)|(S))))) +#define ROP_DPSaxn(D,S,P) (~((D)^((P)&(S)))) +#define ROP_DPSxx(D,S,P) ((D)^((P)^(S))) +#define ROP_PSDPSonoxx(D,S,P) ((P)^((S)^((D)|(~((P)|(S)))))) +#define ROP_SDPSonoxn(D,S,P) (~((S)^((D)|(~((P)|(S)))))) +#define ROP_DSxn(D,S,P) (~((D)^(S))) +#define ROP_DPSnax(D,S,P) ((D)^((P)&(~(S)))) +#define ROP_SDPSoaxn(D,S,P) (~((S)^((D)&((P)|(S))))) +#define ROP_SPDnax(D,S,P) ((S)^((P)&(~(D)))) +#define ROP_DSPDoaxn(D,S,P) (~((D)^((S)&((P)|(D))))) +#define ROP_DSPDSaoxx(D,S,P) ((D)^((S)^((P)|((D)&(S))))) +#define ROP_PDSxan(D,S,P) (~((P)&((D)^(S)))) +#define ROP_DPa(D,S,P) ((D)&(P)) +#define ROP_PDSPnaoxn(D,S,P) (~((P)^((D)|((S)&(~(P)))))) +#define ROP_DPSnoa(D,S,P) ((D)&((P)|(~(S)))) +#define ROP_DPSDxoxn(D,S,P) (~((D)^((P)|((S)^(D))))) +#define ROP_PDSPonoxn(D,S,P) (~((P)^((D)|(~((S)|(P)))))) +#define ROP_PDxn(D,S,P) (~((P)^(D))) +#define ROP_DSPnax(D,S,P) ((D)^((S)&(~(P)))) +#define ROP_PDSPoaxn(D,S,P) (~((P)^((D)&((S)|(P))))) +#define ROP_DPSoa(D,S,P) ((D)&((P)|(S))) +#define ROP_DPSoxn(D,S,P) (~((D)^((P)|(S)))) +#define ROP_D(D,S,P) (D) +#define ROP_DPSono(D,S,P) ((D)|(~((P)|(S)))) +#define ROP_SPDSxax(D,S,P) ((S)^((P)&((D)^(S)))) +#define ROP_DPSDaoxn(D,S,P) (~((D)^((P)|((S)&(D))))) +#define ROP_DSPnao(D,S,P) ((D)|((S)&(~(P)))) +#define ROP_DPno(D,S,P) ((D)|(~(P))) +#define ROP_PDSnoa(D,S,P) ((P)&((D)|(~(S)))) +#define ROP_PDSPxoxn(D,S,P) (~((P)^((D)|((S)^(P))))) +#define ROP_SSPxDSxox(D,S,P) ((S)^(((S)^(P))|((D)^(S)))) +#define ROP_SDPanan(D,S,P) (~((S)&(~((D)&(P))))) +#define ROP_PSDnax(D,S,P) ((P)^((S)&(~(D)))) +#define ROP_DPSDoaxn(D,S,P) (~((D)^((P)&((S)|(D))))) +#define ROP_DPSDPaoxx(D,S,P) ((D)^((P)^((S)|((D)&(P))))) +#define ROP_SDPxan(D,S,P) (~((S)&((D)^(P)))) +#define ROP_PSDPxax(D,S,P) ((P)^((S)&((D)^(P)))) +#define ROP_DSPDaoxn(D,S,P) (~((D)^((S)|((P)&(D))))) +#define ROP_DPSnao(D,S,P) ((D)|((P)&(~(S)))) +#define ROP_DSno(D,S,P) ((D)|(~(S))) /* MERGEPAINT */ +#define ROP_SPDSanax(D,S,P) ((S)^((P)&(~((D)&(S))))) +#define ROP_SDxPDxan(D,S,P) (~(((S)^(D))&((P)^(D)))) +#define ROP_DPSxo(D,S,P) ((D)|((P)^(S))) +#define ROP_DPSano(D,S,P) ((D)|(~((P)&(S)))) +#define ROP_PSa(D,S,P) ((P)&(S)) /* MERGECOPY */ +#define ROP_SPDSnaoxn(D,S,P) (~((S)^((P)|((D)&(~(S)))))) +#define ROP_SPDSonoxn(D,S,P) (~((S)^((P)|(~((D)|(S)))))) +#define ROP_PSxn(D,S,P) (~((P)^(S))) +#define ROP_SPDnoa(D,S,P) ((S)&((P)|(~(D)))) +#define ROP_SPDSxoxn(D,S,P) (~((S)^((P)|((D)^(S))))) +#define ROP_SDPnax(D,S,P) ((S)^((D)&(~(P)))) +#define ROP_PSDPoaxn(D,S,P) (~((P)^((S)&((D)|(P))))) +#define ROP_SDPoa(D,S,P) ((S)&((D)|(P))) +#define ROP_SPDoxn(D,S,P) (~((S)^((P)|(D)))) +#define ROP_DPSDxax(D,S,P) ((D)^((P)&((S)^(D)))) +#define ROP_SPDSaoxn(D,S,P) (~((S)^((P)|((D)&(S))))) +#define ROP_S(D,S,P) (S) /* SRCCOPY */ +#define ROP_SDPono(D,S,P) ((S)|(~((D)|(P)))) +#define ROP_SDPnao(D,S,P) ((S)|((D)&(~(P)))) +#define ROP_SPno(D,S,P) ((S)|(~(P))) +#define ROP_PSDnoa(D,S,P) ((P)&((S)|(~(D)))) +#define ROP_PSDPxoxn(D,S,P) (~((P)^((S)|((D)^(P))))) +#define ROP_PDSnax(D,S,P) ((P)^((D)&(~(S)))) +#define ROP_SPDSoaxn(D,S,P) (~((S)^((P)&((D)|(S))))) +#define ROP_SSPxPDxax(D,S,P) ((S)^(((S)^(P))&((P)^(D)))) +#define ROP_DPSanan(D,S,P) (~((D)&(~((P)&(S))))) +#define ROP_PSDPSaoxx(D,S,P) ((P)^((S)^((D)|((P)&(S))))) +#define ROP_DPSxan(D,S,P) (~((D)&((P)^(S)))) +#define ROP_PDSPxax(D,S,P) ((P)^((D)&((S)^(P)))) +#define ROP_SDPSaoxn(D,S,P) (~((S)^((D)|((P)&(S))))) +#define ROP_DPSDanax(D,S,P) ((D)^((P)&(~((S)&(D))))) +#define ROP_SPxDSxan(D,S,P) (~(((S)^(P))&((D)^(S)))) +#define ROP_SPDnao(D,S,P) ((S)|((P)&(~(D)))) +#define ROP_SDno(D,S,P) ((S)|(~(D))) +#define ROP_SDPxo(D,S,P) ((S)|((D)^(P))) +#define ROP_SDPano(D,S,P) ((S)|(~((D)&(P)))) +#define ROP_PDSoa(D,S,P) ((P)&((D)|(S))) +#define ROP_PDSoxn(D,S,P) (~((P)^((D)|(S)))) +#define ROP_DSPDxax(D,S,P) ((D)^((S)&((P)^(D)))) +#define ROP_PSDPaoxn(D,S,P) (~((P)^((S)|((D)&(P))))) +#define ROP_SDPSxax(D,S,P) ((S)^((D)&((P)^(S)))) +#define ROP_PDSPaoxn(D,S,P) (~((P)^((D)|((S)&(P))))) +#define ROP_SDPSanax(D,S,P) ((S)^((D)&(~((P)&(S))))) +#define ROP_SPxPDxan(D,S,P) (~(((S)^(P))&((P)^(D)))) +#define ROP_SSPxDSxax(D,S,P) ((S)^(((S)^(P))&((D)^(S)))) +#define ROP_DSPDSanaxxn(D,S,P) (~((D)^((S)^((P)&(~((D)&(S))))))) +#define ROP_DPSao(D,S,P) ((D)|((P)&(S))) +#define ROP_DPSxno(D,S,P) ((D)|(~((P)^(S)))) +#define ROP_SDPao(D,S,P) ((S)|((D)&(P))) +#define ROP_SDPxno(D,S,P) ((S)|(~((D)^(P)))) +#define ROP_DSo(D,S,P) ((D)|(S)) /* SRCPAINT */ +#define ROP_SDPnoo(D,S,P) ((S)|((D)|(~(P)))) +#define ROP_P(D,S,P) (P) /* PATCOPY */ +#define ROP_PDSono(D,S,P) ((P)|(~((D)|(S)))) +#define ROP_PDSnao(D,S,P) ((P)|((D)&(~(S)))) +#define ROP_PSno(D,S,P) ((P)|(~(S))) +#define ROP_PSDnao(D,S,P) ((P)|((S)&(~(D)))) +#define ROP_PDno(D,S,P) ((P)|(~(D))) +#define ROP_PDSxo(D,S,P) ((P)|((D)^(S))) +#define ROP_PDSano(D,S,P) ((P)|(~((D)&(S)))) +#define ROP_PDSao(D,S,P) ((P)|((D)&(S))) +#define ROP_PDSxno(D,S,P) ((P)|(~((D)^(S)))) +#define ROP_DPo(D,S,P) ((D)|(P)) +#define ROP_DPSnoo(D,S,P) ((D)|((P)|(~(S)))) /* PATPAINT */ +#define ROP_PSo(D,S,P) ((P)|(S)) +#define ROP_PSDnoo(D,S,P) ((P)|((S)|(~(D)))) +#define ROP_DPSoo(D,S,P) ((D)|((P)|(S))) +#define ROP_1(D,S,P) 1 /* WHITENESS */ + +#define ROP_BLACKNESS ROP_0 +#define ROP_NOTSRCERASE ROP_DSon +#define ROP_NOTSRCCOPY ROP_Sn +#define ROP_SRCERASE ROP_SDna +#define ROP_DSTINVERT ROP_Dn +#define ROP_PATINVERT ROP_DPx +#define ROP_SRCINVERT ROP_DSx +#define ROP_SRCAND ROP_DSa +#define ROP_MERGEPAINT ROP_DSno +#define ROP_MERGECOPY ROP_PSa +#define ROP_SRCCOPY ROP_S +#define ROP_SRCPAINT ROP_DSo +#define ROP_PATCOPY ROP_P +#define ROP_PATPAINT ROP_DPSnoo +#define ROP_WHITENESS ROP_1 + + diff --git a/reactos/subsystems/win32/win32k/diblib/SrcPaint.c b/reactos/subsystems/win32/win32k/diblib/SrcPaint.c new file mode 100644 index 00000000000..9a332452174 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/SrcPaint.c @@ -0,0 +1,24 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 0 +#define __USES_DEST 1 +#define __USES_MASK 0 + +#define __FUNCTIONNAME SrcPaint + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[0](D,S,0) + +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_SrcPaint(PBLTDATA pBltData) +{ + // TODO: XLATEless same-surface variants + gapfnSrcPaint[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); +} + + + diff --git a/reactos/subsystems/win32/win32k/diblib/SrcPatBlt.c b/reactos/subsystems/win32/win32k/diblib/SrcPatBlt.c new file mode 100644 index 00000000000..3d8764c56be --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/SrcPatBlt.c @@ -0,0 +1,37 @@ + +#include "DibLib.h" + +#define __USES_SOURCE 1 +#define __USES_PATTERN 1 +#define __USES_DEST 0 +#define __USES_MASK 0 + +#define __FUNCTIONNAME SrcPatBlt + +#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[0](0,S,P) + +#include "diblib_allsrcbpp.h" + +#undef __FUNCTIONNAME +#define __FUNCTIONNAME SrcPatBlt_Solid +#define __USES_SOLID_BRUSH 1 +#include "diblib_allsrcbpp.h" + +VOID +FASTCALL +Dib_SrcPatBlt(PBLTDATA pBltData) +{ + /* Check for solid brush */ + if (pBltData->ulSolidColor != 0xFFFFFFFF) + { + /* Use the solid version of PATCOPY! */ + gapfnSrcPatBlt_Solid[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); + } + else + { + /* Use the pattern version */ + gapfnSrcPatBlt[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData); + } +} + + diff --git a/reactos/subsystems/win32/win32k/diblib/engbitblt.c b/reactos/subsystems/win32/win32k/diblib/engbitblt.c new file mode 100644 index 00000000000..df0cca7afe8 --- /dev/null +++ b/reactos/subsystems/win32/win32k/diblib/engbitblt.c @@ -0,0 +1,282 @@ + +#include "DibLib.h" + +#define ROP4_FGND(Rop4) ((Rop4) & 0x00FF) +#define ROP4_BKGND(Rop4) (((Rop4) & 0xFF00) >> 8) + +#define ROP4_USES_SOURCE(Rop4) (((((Rop4) & 0xCC00) >> 2) != ((Rop4) & 0x3300)) || ((((Rop4) & 0xCC) >> 2) != ((Rop4) & 0x33))) +#define ROP4_USES_MASK(Rop4) (((Rop4) & 0xFF00) != (((Rop4) & 0xff) << 8)) +#define ROP4_USES_DEST(Rop4) (((((Rop4) & 0xAA) >> 1) != ((Rop4) & 0x55)) || ((((Rop4) & 0xAA00) >> 1) != ((Rop4) & 0x5500))) +#define ROP4_USES_PATTERN(Rop4) (((((Rop4) & 0xF0) >> 4) != ((Rop4) & 0x0F)) || ((((Rop4) & 0xF000) >> 4) != ((Rop4) & 0x0F00))) + + +typedef struct +{ + ULONG c; + RECTL arcl[5]; +} RECT_ENUM; + +static +VOID +AdjustOffsetAndSize( + _Out_ PPOINTL pptOffset, + _Out_ PSIZEL psizTrg, + _In_ PPOINTL pptlSrc, + _In_ PSIZEL psizSrc) +{ + ULONG x, y, cxMax, cyMax; + + x = pptlSrc->x + pptOffset->x; + if (x < 0) pptOffset->x -= x, x = 0; + + cxMax = psizSrc->cx - x; + if (psizTrg->cx > cxMax) psizTrg->cx= cxMax; + + y = pptlSrc->y + pptOffset->y; + if (y < 0) pptOffset->y -= y, y = 0; + + cyMax = psizSrc->cy - y; + if (psizTrg->cy > cyMax) psizTrg->cy = cyMax; +} + +BOOL +APIENTRY +EngBitBlt( + _Inout_ SURFOBJ *psoTrg, + _In_opt_ SURFOBJ *psoSrc, + _In_opt_ SURFOBJ *psoMask, + _In_opt_ CLIPOBJ *pco, + _In_opt_ XLATEOBJ *pxlo, + _In_ RECTL *prclTrg, + _When_(psoSrc, _In_) POINTL *pptlSrc, + _When_(psoMask, _In_) POINTL *pptlMask, + _In_opt_ BRUSHOBJ *pbo, + _When_(pbo, _In_) POINTL *pptlBrush, + _In_ ROP4 rop4) +{ + BLTDATA bltdata; + ULONG i, iDComplexity, iDirection, rop3Fg, iFunctionIndex; + RECTL rcTrg; + POINTL ptOffset, ptSrc, ptMask; + SIZEL sizTrg; + PFN_DIBFUNCTION pfnBitBlt; + BOOL bEnumMore; + RECT_ENUM rcenum; + + /* Clip the target rect to the extents of the target surface */ + rcTrg.left = min(prclTrg->left, 0); + rcTrg.top = min(prclTrg->top, 0); + rcTrg.right = min(prclTrg->right, psoTrg->sizlBitmap.cx); + rcTrg.bottom = min(prclTrg->bottom, psoTrg->sizlBitmap.cy); + + /* Check if there is a clipping region */ + iDComplexity = pco ? pco->iDComplexity : DC_TRIVIAL; + if (iDComplexity != DC_TRIVIAL) + { + /* Clip the target rect to the bounds of the clipping region */ + RECTL_bIntersectRect(&rcTrg, prclTrg, &pco->rclBounds); + } + + /* Calculate initial offset and size */ + ptOffset.x = rcTrg.left - prclTrg->left; + ptOffset.y = rcTrg.top - prclTrg->top; + sizTrg.cx = rcTrg.right - rcTrg.left; + sizTrg.cy = rcTrg.bottom - rcTrg.top; + + /* Check if the ROP uses a source */ + if (ROP4_USES_SOURCE(rop4)) + { + /* Must have a source surface and point */ + if (!psoSrc || !pptlSrc) return FALSE; + + /* Get the source point */ + ptSrc = *pptlSrc; + + /* Clip against the extents of the source surface */ + AdjustOffsetAndSize(&ptOffset, &sizTrg, &ptSrc, &psoSrc->sizlBitmap); + + /* Check if source and target are equal */ + if (psoSrc == psoTrg) + { + /* Use 0 to mark source as equal to target */ + bltdata.siSrc.iFormat = 0; + + } + else + { + bltdata.siSrc.iFormat = psoSrc->iBitmapFormat; + } + bltdata.siSrc.pjBase = psoSrc->pvScan0; + bltdata.siSrc.lDelta = psoSrc->lDelta; + } + else + { + ptSrc.x = 0; + ptSrc.y = 0; + } + + /* Check if the ROP uses a mask */ + if (ROP4_USES_MASK(rop4)) + { + /* Must have a mask surface and point */ + if (!psoMask || !pptlMask) return FALSE; + + /* Get the mask point */ + ptMask = *pptlMask; + + /* Clip against the extents of the mask surface */ + AdjustOffsetAndSize(&ptOffset, &sizTrg, &ptMask, &psoMask->sizlBitmap); + + bltdata.siMsk.iFormat = psoMask->iBitmapFormat; + bltdata.siMsk.pjBase = psoMask->pvScan0; + bltdata.siMsk.lDelta = psoMask->lDelta; + } + else + { + ptMask.x = 0; + ptMask.y = 0; + } + + /* Adjust the points */ + ptSrc.x += ptOffset.x; + ptSrc.y += ptOffset.y; + ptMask.x += ptOffset.x; + ptMask.y += ptOffset.y; + + /* Recalculate the target rect */ + rcTrg.left = prclTrg->left + ptOffset.x; + rcTrg.top = prclTrg->top + ptOffset.y; + rcTrg.right = rcTrg.left + sizTrg.cx; + rcTrg.bottom = rcTrg.top + sizTrg.cy; + + bltdata.ulWidth = prclTrg->right - prclTrg->left; + bltdata.ulHeight = prclTrg->bottom - prclTrg->top; + bltdata.pxlo = pxlo; + bltdata.rop4 = rop4; + + bltdata.siDst.iFormat = psoTrg->iBitmapFormat; + bltdata.siDst.pjBase = psoTrg->pvScan0; + bltdata.siDst.lDelta = psoTrg->lDelta; + bltdata.siDst.ptOrig.x = prclTrg->left; + bltdata.siDst.ptOrig.y = prclTrg->top; + + + /* Check of the ROP uses a pattern / brush */ + if (ROP4_USES_PATTERN(rop4)) + { + /* Must have a brush */ + if (!pbo) return FALSE; + + /* Copy the solid color */ + bltdata.ulSolidColor = pbo->iSolidColor; + + /* Check if this is a pattern brush */ + if (pbo->iSolidColor == 0xFFFFFFFF) + { + // FIXME: use EBRUSHOBJ + + bltdata.siPat.iFormat = 0;//psoPat->iBitmapFormat; + bltdata.siPat.pjBase = 0;//psoPat->pvScan0; + bltdata.siPat.lDelta = 0;//psoPat->lDelta; + bltdata.siPat.ptOrig = *pptlBrush; + + bltdata.ulPatWidth = 0; + bltdata.ulPatHeight = 0; + } + } + + /* Analyze the copying direction */ + if (psoTrg == psoSrc) + { + if (rcTrg.top < ptSrc.y) + iDirection = rcTrg.left < ptSrc.x ? CD_RIGHTDOWN : CD_LEFTDOWN; + else + iDirection = rcTrg.left < ptSrc.x ? CD_RIGHTUP : CD_LEFTUP; + } + else + iDirection = CD_ANY; + + /* Check if this is a masking ROP */ + if (ROP4_USES_MASK(rop4)) + { + bltdata.apfnDoRop[0] = gapfnRop[ROP4_BKGND(rop4)]; + bltdata.apfnDoRop[1] = gapfnRop[ROP4_FGND(rop4)]; + } + + /* Get the foreground ROP index */ + rop3Fg = ROP4_FGND(rop4); + + /* Get the function index */ + iFunctionIndex = aiIndexPerRop[rop3Fg]; + + /* Get the dib function */ + pfnBitBlt = apfnDibFunction[iFunctionIndex]; + + /* Check if we need to enumerate rects */ + if (iDComplexity == DC_COMPLEX) + { + /* Start the enumeration of the clip object */ + CLIPOBJ_cEnumStart(pco, FALSE, CT_RECTANGLES, iDirection, 0); + do + { + /* Enumerate a set of rectangles */ + bEnumMore = CLIPOBJ_bEnum(pco, sizeof(rcenum), (ULONG*)&rcenum); + + /* Loop all rectangles we got */ + for (i = 0; i < rcenum.c; i++) + { + /* Intersect this rect with the already calculated bounds rect */ + if (!RECTL_bIntersectRect(&rcenum.arcl[i], &rcenum.arcl[i], &rcTrg)) + { + /* This rect is outside the valid bounds, continue */ + continue; + } + + /* Copy the target start point */ + bltdata.siDst.ptOrig.x = rcenum.arcl[i].left; + bltdata.siDst.ptOrig.x = rcenum.arcl[i].top; + + /* Calculate width and height of this rect */ + bltdata.ulWidth = rcenum.arcl[i].right - rcenum.arcl[i].left; + bltdata.ulHeight = rcenum.arcl[i].bottom - rcenum.arcl[i].top; + + /* Calculate the offset of this rect from the original coordinates */ + ptOffset.x = rcenum.arcl[i].left - prclTrg->left; + ptOffset.y = rcenum.arcl[i].top - prclTrg->top; + + /* Calculate current origin for source and mask */ + bltdata.siSrc.ptOrig.x = pptlSrc->x + ptOffset.x; + bltdata.siSrc.ptOrig.y = pptlSrc->y + ptOffset.y; + bltdata.siMsk.ptOrig.x = pptlMask->x + ptOffset.x; + bltdata.siMsk.ptOrig.y = pptlMask->y + ptOffset.y; + + //bltdata.siPat.ptOrig.x = (pptlMask->x + ptOffset.x) % psoMask->sizlBitmap.cx; + //bltdata.siPat.ptOrig.y = (pptlMask->y + ptOffset.y) % psoMask->sizlBitmap.cx; + + } + } + while (bEnumMore); + } + else + { + /* Call the dib function */ + pfnBitBlt(&bltdata); + } + + return TRUE; +} + +ULONG +NTAPI +XLATEOBJ_iXlate(XLATEOBJ *pxlo, ULONG ulColor) +{ + return ulColor; +} + +BOOL +//__fastcall +RECTL_bIntersectRect(RECTL* prclDst, const RECTL* prcl1, const RECTL* prcl2) +{ + return TRUE; +} +