diff --git "a/win32ss/gdi/ntgdi/dibobj.c" "b/win32ss/gdi/ntgdi/dibobj.c" index 456210d880a..19823272a50 100644 --- "a/win32ss/gdi/ntgdi/dibobj.c" +++ "b/win32ss/gdi/ntgdi/dibobj.c" @@ -498,6 +498,7 @@ NtGdiSetDIBitsToDeviceInternal( PPALETTE ppalDIB = NULL; LPBITMAPINFO pbmiSafe; BOOL bResult; + ROP4 rop4; if (!Bits) return 0; @@ -678,6 +679,33 @@ NtGdiSetDIBitsToDeviceInternal( ptSource.y -= SourceSize.cy; } + /* This is a HACK fix for the black icons in the toolbars. + * It is a HACK, but it may work OK until it can be fixed correctly. */ + if (pMaskSurf) + { + rop4 = ROP4_MASK; + } + else + { + INT cx, cy; + cx = rcDest.right - rcDest.left; + cy = rcDest.bottom - rcDest.top; + /* Do we have a square that overlays itself? Pixels are multiple of 8? */ + if(StartScan == 0 && bmi->bmiHeader.biHeight == ScanLines && + bmi->bmiHeader.biBitCount == 32 && + ptSource.x == 0 && ptSource.y == 0 && + rcDest.left == 0 && rcDest.top == 0 && + ScanLines == cx && ScanLines == cy && + ScanLines % 8 == 0) + { + rop4 = ROP4_SRCAND; + } + else + { + rop4 = ROP4_FROM_INDEX(R3_OPINDEX_SRCCOPY); + } + } + bResult = IntEngBitBlt(pDestSurf, pSourceSurf, pMaskSurf, @@ -688,7 +716,7 @@ NtGdiSetDIBitsToDeviceInternal( pMaskSurf ? &ptSource : NULL, NULL, NULL, - pMaskSurf ? ROP4_MASK : ROP4_FROM_INDEX(R3_OPINDEX_SRCCOPY)); + rop4); /* Cleanup EXLATEOBJ */ EXLATEOBJ_vCleanup(&exlo);