Author: jimtabor
Date: Sat Sep 12 17:29:16 2015
New Revision: 69202
URL:
http://svn.reactos.org/svn/reactos?rev=69202&view=rev
Log:
[Win32k]
- Fix Alpha Blending while using layered windows in lower bit modes. See CORE-10167.
Modified:
trunk/reactos/win32ss/user/ntuser/layered.c
Modified: trunk/reactos/win32ss/user/ntuser/layered.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/layere…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/layered.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/layered.c [iso-8859-1] Sat Sep 12 17:29:16 2015
@@ -154,7 +154,8 @@
RECT Rect;
BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, 0 };
COLORREF color_key = (info->dwFlags & ULW_COLORKEY) ? info->crKey :
CLR_INVALID;
- HBITMAP hBitmapBuffer, hOldBitmap;
+ HBITMAP hOldBitmap, hOldBitmap1, hbmSrc, hbmDst;
+ DIBSECTION dibs;
Rect = Window;
@@ -165,9 +166,17 @@
if (!info->hdcDst) hdc = UserGetDCEx(pWnd, NULL, DCX_USESTYLE);
else hdc = info->hdcDst;
+ hbmSrc = NtGdiCreateCompatibleBitmap(info->hdcSrc, Rect.right - Rect.left,
Rect.bottom - Rect.top);
+ hbmDst = NtGdiCreateCompatibleBitmap(info->hdcSrc, Rect.right - Rect.left,
Rect.bottom - Rect.top);
+
+ GreGetObject(hbmSrc, sizeof(DIBSECTION), &dibs);
+
+ TRACE("Source Bitmap bc %d\n",dibs.dsBmih.biBitCount);
+
hdcBuffer = NtGdiCreateCompatibleDC(hdc);
- hBitmapBuffer = NtGdiCreateCompatibleBitmap(hdc, Rect.right - Rect.left,
Rect.bottom - Rect.top);
- hOldBitmap = (HBITMAP)NtGdiSelectBitmap(hdcBuffer, hBitmapBuffer);
+
+ hOldBitmap = (HBITMAP)NtGdiSelectBitmap(hdcBuffer, hbmSrc);
+ hOldBitmap1 = (HBITMAP)NtGdiSelectBitmap(hdc, hbmDst);
NtGdiStretchBlt( hdcBuffer,
Rect.left,
@@ -209,8 +218,10 @@
blend,
0);
+ NtGdiSelectBitmap(hdc, hOldBitmap1);
NtGdiSelectBitmap(hdcBuffer, hOldBitmap);
- if (hBitmapBuffer) GreDeleteObject(hBitmapBuffer);
+ if (hbmSrc) GreDeleteObject(hbmSrc);
+ if (hbmDst) GreDeleteObject(hbmDst);
if (hdcBuffer) IntGdiDeleteDC(hdcBuffer, FALSE);
if (!info->hdcDst) UserReleaseDC(pWnd, hdc, FALSE);
}