mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[win32k]
- Add mask offset coordinates to GreStretchBltMask parameters, add code to handle a mask offset - Only fail if the mask is smaller than the color bitmap, print sizes in this case - Adapt callers to GreStretchBltMask changes - DrawIcon: use new features to combine mask and color images - Mouse control panel now shows cursors again (masks still need some work), fixes ~15 user32:cursoricon tests svn path=/trunk/; revision=44803
This commit is contained in:
@@ -258,7 +258,9 @@ GreStretchBltMask(IN HDC hdcDst,
|
||||
IN INT cySrc,
|
||||
IN DWORD dwRop,
|
||||
IN DWORD dwBackColor,
|
||||
IN HDC hdcMask);
|
||||
IN HDC hdcMask,
|
||||
IN INT xMask,
|
||||
IN INT yMask);
|
||||
|
||||
#endif /* _WIN32K_INTGDI_H */
|
||||
|
||||
|
||||
@@ -1362,13 +1362,14 @@ UserDrawIconEx(
|
||||
cyHeight,
|
||||
hdcImage ? hdcImage : hdcMask,
|
||||
0,
|
||||
((diFlags & DI_MASK && !(diFlags & DI_IMAGE)) ||
|
||||
(diFlags & DI_IMAGE && hbmColor) ? 0 : IconSize.cy),
|
||||
0,
|
||||
IconSize.cx,
|
||||
IconSize.cy,
|
||||
SRCCOPY,
|
||||
0,
|
||||
hdcImage ? hdcMask : NULL);
|
||||
hdcMask,
|
||||
0,
|
||||
hdcImage ? 0 : IconSize.cy);
|
||||
}
|
||||
|
||||
if (hOldMask) NtGdiSelectBitmap(hdcMask, hOldMask);
|
||||
|
||||
@@ -703,7 +703,9 @@ GreStretchBltMask(
|
||||
INT HeightSrc,
|
||||
DWORD ROP,
|
||||
IN DWORD dwBackColor,
|
||||
HDC hDCMask)
|
||||
HDC hDCMask,
|
||||
INT XOriginMask,
|
||||
INT YOriginMask)
|
||||
{
|
||||
PDC DCDest;
|
||||
PDC DCSrc = NULL;
|
||||
@@ -713,6 +715,7 @@ GreStretchBltMask(
|
||||
SURFACE *BitmapMask = NULL;
|
||||
RECTL DestRect;
|
||||
RECTL SourceRect;
|
||||
POINTL MaskPoint;
|
||||
BOOL Status = FALSE;
|
||||
EXLATEOBJ exlo;
|
||||
XLATEOBJ *XlateObj = NULL;
|
||||
@@ -827,12 +830,20 @@ GreStretchBltMask(
|
||||
{
|
||||
BitmapMask = DCMask->dclevel.pSurface;
|
||||
if (BitmapMask &&
|
||||
(BitmapMask->SurfObj.sizlBitmap.cx != WidthSrc ||
|
||||
BitmapMask->SurfObj.sizlBitmap.cy != HeightSrc))
|
||||
(BitmapMask->SurfObj.sizlBitmap.cx < WidthSrc ||
|
||||
BitmapMask->SurfObj.sizlBitmap.cy < HeightSrc))
|
||||
{
|
||||
DPRINT1("Mask and bitmap sizes don't match!\n");
|
||||
DPRINT1("%dx%d mask is smaller than %dx%d bitmap\n",
|
||||
BitmapMask->SurfObj.sizlBitmap.cx, BitmapMask->SurfObj.sizlBitmap.cy,
|
||||
WidthSrc, HeightSrc);
|
||||
goto failed;
|
||||
}
|
||||
/* Create mask offset point */
|
||||
MaskPoint.x = XOriginMask;
|
||||
MaskPoint.y = YOriginMask;
|
||||
IntLPtoDP(DCMask, &MaskPoint, 1);
|
||||
MaskPoint.x += DCMask->ptlDCOrig.x;
|
||||
MaskPoint.y += DCMask->ptlDCOrig.x;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -844,7 +855,7 @@ GreStretchBltMask(
|
||||
XlateObj,
|
||||
&DestRect,
|
||||
&SourceRect,
|
||||
NULL,
|
||||
BitmapMask ? &MaskPoint : NULL,
|
||||
&DCDest->eboFill.BrushObject,
|
||||
&BrushOrigin,
|
||||
ROP3_TO_ROP4(ROP));
|
||||
@@ -896,7 +907,9 @@ NtGdiStretchBlt(
|
||||
HeightSrc,
|
||||
ROP,
|
||||
dwBackColor,
|
||||
NULL);
|
||||
NULL,
|
||||
0,
|
||||
0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user