mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
fix TAG_BITMAP redzone overwrite for colordepths != 32 bit
svn path=/trunk/; revision=30790
This commit is contained in:
parent
e611490600
commit
f63f322ecb
1 changed files with 19 additions and 2 deletions
|
@ -1401,8 +1401,7 @@ UserDrawIconEx(
|
|||
}
|
||||
|
||||
/* NtGdiCreateCompatibleBitmap will create a monochrome bitmap
|
||||
when cxWidth or cyHeight is 0
|
||||
*/
|
||||
when cxWidth or cyHeight is 0 */
|
||||
if ((bmpColor.bmBitsPixel == 32) && (cxWidth != 0) && (cyHeight != 0))
|
||||
{
|
||||
bAlpha = TRUE;
|
||||
|
@ -1425,6 +1424,9 @@ UserDrawIconEx(
|
|||
if (DoFlickerFree || bAlpha)
|
||||
{
|
||||
RECT r;
|
||||
BITMAP bm;
|
||||
BITMAPOBJ *BitmapObj = NULL;
|
||||
|
||||
r.right = cxWidth;
|
||||
r.bottom = cyHeight;
|
||||
|
||||
|
@ -1442,6 +1444,21 @@ UserDrawIconEx(
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
/* make sure we have a 32 bit offscreen bitmap
|
||||
otherwise we can't do alpha blending */
|
||||
BitmapObj = BITMAPOBJ_LockBitmap(hbmOff);
|
||||
if (BitmapObj == NULL)
|
||||
{
|
||||
DPRINT1("GDIOBJ_LockObj() failed!\n");
|
||||
goto cleanup;
|
||||
}
|
||||
BITMAP_GetObject(BitmapObj, sizeof(BITMAP), &bm);
|
||||
|
||||
if (bm.bmBitsPixel != 32)
|
||||
bAlpha = FALSE;
|
||||
|
||||
BITMAPOBJ_UnlockBitmap(BitmapObj);
|
||||
|
||||
hOldOffBmp = NtGdiSelectObject(hdcOff, hbmOff);
|
||||
if (!hOldOffBmp)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue