Author: tkreuzer Date: Wed Feb 11 21:34:42 2015 New Revision: 66229
URL: http://svn.reactos.org/svn/reactos?rev=66229&view=rev Log: [WIN32K] - Handle the case where we have a masked ROP, but no mask surface in EngBitBlt - Alloc ROPs with a mask in EngPaint Fixes ASSERT when GoogleEarth is launched.
Modified: trunk/reactos/win32ss/gdi/eng/bitblt.c trunk/reactos/win32ss/gdi/eng/bitblt_new.c trunk/reactos/win32ss/gdi/eng/paint.c
Modified: trunk/reactos/win32ss/gdi/eng/bitblt.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/bitblt.c?re... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/bitblt.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/bitblt.c [iso-8859-1] Wed Feb 11 21:34:42 2015 @@ -458,6 +458,19 @@ else { 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)
Modified: trunk/reactos/win32ss/gdi/eng/bitblt_new.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/bitblt_new.... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] Wed Feb 11 21:34:42 2015 @@ -210,7 +210,7 @@ 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,11 +253,22 @@ /* 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;
Modified: trunk/reactos/win32ss/gdi/eng/paint.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/paint.c?rev... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/paint.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/paint.c [iso-8859-1] Wed Feb 11 21:34:42 2015 @@ -63,9 +63,8 @@ /* 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,