mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 06:21:23 +00:00
[Win32k]
- Fix some composition drawing while using layered windows. See CORE-10155 and CORE-10157. svn path=/trunk/; revision=69197
This commit is contained in:
parent
393d90900e
commit
59b9ff5e23
1 changed files with 27 additions and 13 deletions
|
@ -150,11 +150,11 @@ IntUpdateLayeredWindowI( PWND pWnd,
|
||||||
|
|
||||||
if (info->hdcSrc)
|
if (info->hdcSrc)
|
||||||
{
|
{
|
||||||
HBRUSH hBr;
|
HDC hdc, hdcBuffer;
|
||||||
HDC hdc;
|
|
||||||
RECT Rect;
|
RECT Rect;
|
||||||
BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, 0 };
|
BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, 0 };
|
||||||
COLORREF color_key = (info->dwFlags & ULW_COLORKEY) ? info->crKey : CLR_INVALID;
|
COLORREF color_key = (info->dwFlags & ULW_COLORKEY) ? info->crKey : CLR_INVALID;
|
||||||
|
HBITMAP hBitmapBuffer, hOldBitmap;
|
||||||
|
|
||||||
Rect = Window;
|
Rect = Window;
|
||||||
|
|
||||||
|
@ -165,13 +165,24 @@ IntUpdateLayeredWindowI( PWND pWnd,
|
||||||
if (!info->hdcDst) hdc = UserGetDCEx(pWnd, NULL, DCX_USESTYLE);
|
if (!info->hdcDst) hdc = UserGetDCEx(pWnd, NULL, DCX_USESTYLE);
|
||||||
else hdc = info->hdcDst;
|
else hdc = info->hdcDst;
|
||||||
|
|
||||||
hBr = NtGdiCreateSolidBrush(color_key, NULL);
|
hdcBuffer = NtGdiCreateCompatibleDC(hdc);
|
||||||
if (hBr)
|
hBitmapBuffer = NtGdiCreateCompatibleBitmap(hdc, Rect.right - Rect.left, Rect.bottom - Rect.top);
|
||||||
{
|
hOldBitmap = (HBITMAP)NtGdiSelectBitmap(hdcBuffer, hBitmapBuffer);
|
||||||
TRACE("Fill Color Key %x\n",color_key);
|
|
||||||
FillRect(hdc, &Rect, hBr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
NtGdiStretchBlt( hdcBuffer,
|
||||||
|
Rect.left,
|
||||||
|
Rect.top,
|
||||||
|
Rect.right - Rect.left,
|
||||||
|
Rect.bottom - Rect.top,
|
||||||
|
info->hdcSrc,
|
||||||
|
Rect.left + (info->pptSrc ? info->pptSrc->x : 0),
|
||||||
|
Rect.top + (info->pptSrc ? info->pptSrc->y : 0),
|
||||||
|
Rect.right - Rect.left,
|
||||||
|
Rect.bottom - Rect.top,
|
||||||
|
SRCCOPY,
|
||||||
|
color_key );
|
||||||
|
|
||||||
|
// Need to test this, Dirty before or after StretchBlt?
|
||||||
if (info->prcDirty)
|
if (info->prcDirty)
|
||||||
{
|
{
|
||||||
ERR("prcDirty\n");
|
ERR("prcDirty\n");
|
||||||
|
@ -182,7 +193,7 @@ IntUpdateLayeredWindowI( PWND pWnd,
|
||||||
if (info->dwFlags & ULW_ALPHA)
|
if (info->dwFlags & ULW_ALPHA)
|
||||||
{
|
{
|
||||||
blend = *info->pblend;
|
blend = *info->pblend;
|
||||||
TRACE("ULW_ALPHA bop %d scA %d aF %d\n", blend.BlendOp, blend.SourceConstantAlpha, blend.AlphaFormat);
|
TRACE("ULW_ALPHA bop %d Alpha %d aF %d\n", blend.BlendOp, blend.SourceConstantAlpha, blend.AlphaFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = NtGdiAlphaBlend( hdc,
|
ret = NtGdiAlphaBlend( hdc,
|
||||||
|
@ -190,14 +201,17 @@ IntUpdateLayeredWindowI( PWND pWnd,
|
||||||
Rect.top,
|
Rect.top,
|
||||||
Rect.right - Rect.left,
|
Rect.right - Rect.left,
|
||||||
Rect.bottom - Rect.top,
|
Rect.bottom - Rect.top,
|
||||||
info->hdcSrc,
|
hdcBuffer,
|
||||||
Rect.left + (info->pptSrc ? info->pptSrc->x : 0),
|
Rect.left + (info->pptSrc ? info->pptSrc->x : 0),
|
||||||
Rect.top + (info->pptSrc ? info->pptSrc->y : 0),
|
Rect.top + (info->pptSrc ? info->pptSrc->y : 0),
|
||||||
Rect.right - Rect.left, Rect.bottom - Rect.top,
|
Rect.right - Rect.left,
|
||||||
|
Rect.bottom - Rect.top,
|
||||||
blend,
|
blend,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
if (hBr) GreDeleteObject(hBr);
|
NtGdiSelectBitmap(hdcBuffer, hOldBitmap);
|
||||||
|
if (hBitmapBuffer) GreDeleteObject(hBitmapBuffer);
|
||||||
|
if (hdcBuffer) IntGdiDeleteDC(hdcBuffer, FALSE);
|
||||||
if (!info->hdcDst) UserReleaseDC(pWnd, hdc, FALSE);
|
if (!info->hdcDst) UserReleaseDC(pWnd, hdc, FALSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue