diff --git a/reactos/win32ss/gdi/eng/bitblt.c b/reactos/win32ss/gdi/eng/bitblt.c index 8b6dd0009d2..83bc508470d 100644 --- a/reactos/win32ss/gdi/eng/bitblt.c +++ b/reactos/win32ss/gdi/eng/bitblt.c @@ -460,6 +460,19 @@ EngBitBlt( clippingType = pco->iDComplexity; } + /* Check if we need a mask but have no mask surface */ + if (UsesMask && (psoMask == NULL)) + { + /* Check if the BRUSHOBJ can provide the mask */ + psoMask = BRUSHOBJ_psoMask(pbo); + if (psoMask == NULL) + { + /* We have no mask, assume the mask is all foreground */ + rop4 &= (rop4 & 0xFF) || ((rop4 & 0xFF) << 8); + UsesMask = FALSE; + } + } + if (UsesMask) { BltRectFunc = BltMask; diff --git a/reactos/win32ss/gdi/eng/bitblt_new.c b/reactos/win32ss/gdi/eng/bitblt_new.c index b5fdd1bf473..56bfade89f4 100644 --- a/reactos/win32ss/gdi/eng/bitblt_new.c +++ b/reactos/win32ss/gdi/eng/bitblt_new.c @@ -210,7 +210,7 @@ EngBitBlt( if (ROP4_USES_PATTERN(rop4)) { /* Must have a brush */ - ASSERT(pbo); // FIXME: test this! + NT_ASSERT(pbo); // FIXME: test this! /* Copy the solid color */ bltdata.ulSolidColor = pbo->iSolidColor; @@ -253,12 +253,23 @@ EngBitBlt( /* Check if the ROP uses a mask */ if (ROP4_USES_MASK(rop4)) { - /* Must have a mask surface and point */ - ASSERT(psoMask); - ASSERT(pptlMask); - //__debugbreak(); + /* Check if we don't have a mask surface */ + if (psoMask == NULL) + { + /* Must have a brush */ + NT_ASSERT(pbo); // FIXME: test this! + + /* Check if the BRUSHOBJ can provide the mask */ + psoMask = BRUSHOBJ_psoMask(pbo); + if (psoMask == NULL) + { + /* We have no mask, assume the mask is all foreground */ + rop4 = (rop4 & 0xFF) || ((rop4 & 0xFF) << 8); + } + } + /* Set the mask format info */ bltdata.siMsk.iFormat = psoMask->iBitmapFormat; bltdata.siMsk.pvScan0 = psoMask->pvScan0; diff --git a/reactos/win32ss/gdi/eng/paint.c b/reactos/win32ss/gdi/eng/paint.c index 95d334dc8f1..97874489cfe 100644 --- a/reactos/win32ss/gdi/eng/paint.c +++ b/reactos/win32ss/gdi/eng/paint.c @@ -63,9 +63,8 @@ EngPaint( /* Convert the MIX, consisting of 2 ROP2 codes into a ROP4 */ rop4 = MIX_TO_ROP4(mix); - /* Sanity checks */ + /* Sanity check */ NT_ASSERT(!ROP4_USES_SOURCE(rop4)); - NT_ASSERT(!ROP4_USES_MASK(rop4)); /* Forward the call to Eng/DrvBitBlt */ return IntEngBitBlt(pso,