- Fix a coordinate problem that occurred with alphablend in DrawIconEx (32bpp mode only)

- Welcome back mixer icon in 32bpp mode!
- Note for other invisible icons in that mode: 32bpp icon variants are most likely missing in the *.ico file; ReactOS image bpp conversion functions currently clear the alpha channel -> invisibility
- Update function names in debug prints, remove duplicate code, slightly improve code readability

svn path=/trunk/; revision=38607
This commit is contained in:
Gregor Schneider 2009-01-06 17:12:07 +00:00
parent 3fec61d4a6
commit 06332c431c

View file

@ -1569,7 +1569,7 @@ UserDrawIconEx(
BitmapObj = BITMAPOBJ_LockBitmap(hbmOff); BitmapObj = BITMAPOBJ_LockBitmap(hbmOff);
if (BitmapObj == NULL) if (BitmapObj == NULL)
{ {
DPRINT1("GDIOBJ_LockObj() failed!\n"); DPRINT1("BITMAPOBJ_LockBitmap() failed!\n");
goto cleanup; goto cleanup;
} }
BITMAP_GetObject(BitmapObj, sizeof(BITMAP), (PVOID)&bm); BITMAP_GetObject(BitmapObj, sizeof(BITMAP), (PVOID)&bm);
@ -1591,7 +1591,7 @@ UserDrawIconEx(
hOldOffBrush = NtGdiSelectBrush(hdcOff, hbrFlickerFreeDraw); hOldOffBrush = NtGdiSelectBrush(hdcOff, hbrFlickerFreeDraw);
if (!hOldOffBrush) if (!hOldOffBrush)
{ {
DPRINT1("NtGdiSelectBitmap() failed!\n"); DPRINT1("NtGdiSelectBrush() failed!\n");
goto cleanup; goto cleanup;
} }
@ -1622,22 +1622,19 @@ UserDrawIconEx(
goto cleanup; goto cleanup;
} }
DoStretchBlt(hdcOff, (DoFlickerFree ? 0 : xLeft), DoStretchBlt(hdcOff,
(DoFlickerFree ? 0 : yTop), cxWidth, cyHeight, hdcMem, (DoFlickerFree || bAlpha ? 0 : xLeft),
0, 0, IconSize.cx, IconSize.cy, (DoFlickerFree || bAlpha ? 0 : yTop),
((diFlags & DI_IMAGE) ? SRCAND : SRCCOPY), FALSE); cxWidth,
cyHeight,
if (!hbmColor && (bmpMask.bmHeight == 2 * bmpMask.bmWidth) hdcMem,
&& (diFlags & DI_IMAGE)) 0,
{ 0,
DoStretchBlt(hdcOff, (DoFlickerFree ? 0 : xLeft), IconSize.cx,
(DoFlickerFree ? 0 : yTop), cxWidth, cyHeight, hdcMem, IconSize.cy,
0, IconSize.cy, IconSize.cx, IconSize.cy, SRCINVERT, ((diFlags & DI_IMAGE) ? SRCAND : SRCCOPY),
FALSE); FALSE);
diFlags &= ~DI_IMAGE;
}
NtGdiSelectBitmap(hdcMem, hOldMem); NtGdiSelectBitmap(hdcMem, hOldMem);
} }
@ -1645,9 +1642,16 @@ UserDrawIconEx(
{ {
hOldMem = NtGdiSelectBitmap(hdcMem, (hbmColor ? hbmColor : hbmMask)); hOldMem = NtGdiSelectBitmap(hdcMem, (hbmColor ? hbmColor : hbmMask));
DoStretchBlt(hdcOff, (DoFlickerFree ? 0 : xLeft), DoStretchBlt(hdcOff,
(DoFlickerFree ? 0 : yTop), cxWidth, cyHeight, hdcMem, (DoFlickerFree || bAlpha ? 0 : xLeft),
0, (hbmColor ? 0 : IconSize.cy), IconSize.cx, IconSize.cy, (DoFlickerFree || bAlpha ? 0 : yTop),
cxWidth,
cyHeight,
hdcMem,
0,
(hbmColor ? 0 : IconSize.cy),
IconSize.cx,
IconSize.cy,
((diFlags & DI_MASK) ? SRCINVERT : SRCCOPY), ((diFlags & DI_MASK) ? SRCINVERT : SRCCOPY),
NULL != hbmColor); NULL != hbmColor);
@ -1668,7 +1672,7 @@ UserDrawIconEx(
BitmapObj = BITMAPOBJ_LockBitmap(hbmOff); BitmapObj = BITMAPOBJ_LockBitmap(hbmOff);
if (BitmapObj == NULL) if (BitmapObj == NULL)
{ {
DPRINT1("GDIOBJ_LockObj() failed!\n"); DPRINT1("BITMAPOBJ_LockBitmap() failed!\n");
goto cleanup; goto cleanup;
} }
BITMAP_GetObject(BitmapObj, sizeof(BITMAP), (PVOID)&bm); BITMAP_GetObject(BitmapObj, sizeof(BITMAP), (PVOID)&bm);