diff --git a/reactos/subsystems/win32/win32k/dib/dib.h b/reactos/subsystems/win32/win32k/dib/dib.h index 5db2f042c7e..440162a744f 100644 --- a/reactos/subsystems/win32/win32k/dib/dib.h +++ b/reactos/subsystems/win32/win32k/dib/dib.h @@ -1,9 +1,5 @@ #pragma once -#ifdef _M_IX86 -#define memset4(dest, value, count) asm volatile("rep stosl" : : "D"(dest), "a"(value), "c"(count) : "memory"); -#endif - #define ROP4_BLACKNESS ((((0x00000042) >> 8) & 0xff00) | (((0x00000042) >> 16) & 0x00ff)) #define ROP4_NOTSRCERASE ((((0x001100A6) >> 8) & 0xff00) | (((0x001100A6) >> 16) & 0x00ff)) #define ROP4_NOTSRCCOPY ((((0x00330008) >> 8) & 0xff00) | (((0x00330008) >> 16) & 0x00ff)) diff --git a/reactos/subsystems/win32/win32k/eng/bitblt_new.c b/reactos/subsystems/win32/win32k/eng/bitblt_new.c index e796412755d..91affcab03c 100644 --- a/reactos/subsystems/win32/win32k/eng/bitblt_new.c +++ b/reactos/subsystems/win32/win32k/eng/bitblt_new.c @@ -98,7 +98,6 @@ EngBitBlt( RECT_ENUM rcenum; PSIZEL psizlPat; -__debugbreak(); ASSERT(psoTrg); ASSERT(psoTrg->iBitmapFormat >= BMF_1BPP); @@ -112,6 +111,7 @@ __debugbreak(); rcTrg = *prclTrg; bltdata.rop4 = rop4; + if (!pxlo) pxlo = &gexloTrivial.xlo; bltdata.pxlo = pxlo; bltdata.pfnXlate = XLATEOBJ_pfnXlate(pxlo); @@ -170,7 +170,7 @@ __debugbreak(); bltdata.siDst.iFormat = psoTrg->iBitmapFormat; } - /* Check of the ROP uses a pattern / brush */ + /* Check if the ROP uses a pattern / brush */ if (ROP4_USES_PATTERN(rop4)) { /* Must have a brush */ @@ -213,6 +213,8 @@ __debugbreak(); ASSERT(psoMask); ASSERT(pptlMask); + __debugbreak(); + bltdata.siMsk.iFormat = psoMask->iBitmapFormat; bltdata.siMsk.pvScan0 = psoMask->pvScan0; bltdata.siMsk.lDelta = psoMask->lDelta; @@ -220,17 +222,21 @@ __debugbreak(); bltdata.apfnDoRop[0] = gapfnRop[ROP4_BKGND(rop4)]; bltdata.apfnDoRop[1] = gapfnRop[ROP4_FGND(rop4)]; - ASSERT(FALSE); - // get masking function! - pfnBitBlt = 0; + /* Calculate the masking function index */ + iFunctionIndex = ROP4_USES_PATTERN(rop4) ? 1 : 0; + iFunctionIndex |= ROP4_USES_SOURCE(rop4) ? 2 : 0; + iFunctionIndex |= ROP4_USES_DEST(rop4) ? 4 : 0; + + /* Get the masking function */ + pfnBitBlt = gapfnMaskFunction[iFunctionIndex]; } else { /* Get the function index from the foreground ROP index*/ - iFunctionIndex = aiIndexPerRop[ROP4_FGND(rop4)]; + iFunctionIndex = gajIndexPerRop[ROP4_FGND(rop4)]; /* Get the dib function */ - pfnBitBlt = apfnDibFunction[iFunctionIndex]; + pfnBitBlt = gapfnDibFunction[iFunctionIndex]; } /* If no clip object is given, use trivial one */ @@ -557,20 +563,4 @@ NtGdiEngBitBlt( return bResult; } -BOOL -NTAPI -IntEngMaskBlt( - SURFOBJ *psoDest, - SURFOBJ *psoMask, - CLIPOBJ *pco, - XLATEOBJ *pxloDest, - XLATEOBJ *pxloSource, - RECTL *DestRect, - POINTL *pptlMask, - BRUSHOBJ *pbo, - POINTL *pptlBrushOrigin) -{ - ASSERT(FALSE); - return 0; -} diff --git a/reactos/subsystems/win32/win32k/eng/drvdbg.c b/reactos/subsystems/win32/win32k/eng/drvdbg.c index edb41e2fdc9..aba1ba68e70 100644 --- a/reactos/subsystems/win32/win32k/eng/drvdbg.c +++ b/reactos/subsystems/win32/win32k/eng/drvdbg.c @@ -307,6 +307,8 @@ DbgDrvBitBlt( ASSERT(prclTrg->right <= psoTrg->sizlBitmap.cx); ASSERT(prclTrg->bottom <= psoTrg->sizlBitmap.cy); ASSERT(RECTL_bIsWellOrdered(prclTrg)); + ASSERT(pco); + ASSERT(pco->iDComplexity != DC_RECT); if (ROP4_USES_SOURCE(rop4)) { diff --git a/reactos/subsystems/win32/win32k/eng/xlate.c b/reactos/subsystems/win32/win32k/eng/xlate.c index 08b71b86f36..b80e950800b 100644 --- a/reactos/subsystems/win32/win32k/eng/xlate.c +++ b/reactos/subsystems/win32/win32k/eng/xlate.c @@ -14,13 +14,15 @@ /** Globals *******************************************************************/ -ULONG giUniqueXlate = 0; +EXLATEOBJ gexloTrivial = {{0, XO_TRIVIAL, 0, 0, 0, 0}, EXLATEOBJ_iXlateTrivial}; -const BYTE gajXlate5to8[32] = +static ULONG giUniqueXlate = 0; + +static const BYTE gajXlate5to8[32] = { 0, 8, 16, 25, 33, 41, 49, 58, 66, 74, 82, 90, 99,107,115,123, 132,140,148,156,165,173,181,189,197,206,214,222,231,239,247,255}; -const BYTE gajXlate6to8[64] = +static const BYTE gajXlate6to8[64] = { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 45, 49, 52, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97,101,105,109,113,117,121,125, 130,134,138,142,146,150,154,158,162,166,170,174,178,182,186,190, diff --git a/reactos/subsystems/win32/win32k/include/xlateobj.h b/reactos/subsystems/win32/win32k/include/xlateobj.h index d61da38df5e..54b5807fa9b 100644 --- a/reactos/subsystems/win32/win32k/include/xlateobj.h +++ b/reactos/subsystems/win32/win32k/include/xlateobj.h @@ -38,6 +38,19 @@ typedef struct _EXLATEOBJ }; } EXLATEOBJ, *PEXLATEOBJ; +PFN_XLATE +FORCEINLINE +XLATEOBJ_pfnXlate(XLATEOBJ *pxlo) +{ + return ((PEXLATEOBJ)pxlo)->pfnXlate; +} + +extern EXLATEOBJ gexloTrivial; + +ULONG +FASTCALL +EXLATEOBJ_iXlateTrivial(PEXLATEOBJ pexlo, ULONG iColor); + void DbgCmpXlate(XLATEOBJ *pxlo1, XLATEOBJ *pxlo2);