- 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:
Gregor Schneider 2009-12-29 18:21:00 +00:00
parent f8e8de57e0
commit b13b720381
3 changed files with 26 additions and 10 deletions

View file

@ -258,7 +258,9 @@ GreStretchBltMask(IN HDC hdcDst,
IN INT cySrc, IN INT cySrc,
IN DWORD dwRop, IN DWORD dwRop,
IN DWORD dwBackColor, IN DWORD dwBackColor,
IN HDC hdcMask); IN HDC hdcMask,
IN INT xMask,
IN INT yMask);
#endif /* _WIN32K_INTGDI_H */ #endif /* _WIN32K_INTGDI_H */

View file

@ -1362,13 +1362,14 @@ UserDrawIconEx(
cyHeight, cyHeight,
hdcImage ? hdcImage : hdcMask, hdcImage ? hdcImage : hdcMask,
0, 0,
((diFlags & DI_MASK && !(diFlags & DI_IMAGE)) || 0,
(diFlags & DI_IMAGE && hbmColor) ? 0 : IconSize.cy),
IconSize.cx, IconSize.cx,
IconSize.cy, IconSize.cy,
SRCCOPY, SRCCOPY,
0, 0,
hdcImage ? hdcMask : NULL); hdcMask,
0,
hdcImage ? 0 : IconSize.cy);
} }
if (hOldMask) NtGdiSelectBitmap(hdcMask, hOldMask); if (hOldMask) NtGdiSelectBitmap(hdcMask, hOldMask);

View file

@ -703,7 +703,9 @@ GreStretchBltMask(
INT HeightSrc, INT HeightSrc,
DWORD ROP, DWORD ROP,
IN DWORD dwBackColor, IN DWORD dwBackColor,
HDC hDCMask) HDC hDCMask,
INT XOriginMask,
INT YOriginMask)
{ {
PDC DCDest; PDC DCDest;
PDC DCSrc = NULL; PDC DCSrc = NULL;
@ -713,6 +715,7 @@ GreStretchBltMask(
SURFACE *BitmapMask = NULL; SURFACE *BitmapMask = NULL;
RECTL DestRect; RECTL DestRect;
RECTL SourceRect; RECTL SourceRect;
POINTL MaskPoint;
BOOL Status = FALSE; BOOL Status = FALSE;
EXLATEOBJ exlo; EXLATEOBJ exlo;
XLATEOBJ *XlateObj = NULL; XLATEOBJ *XlateObj = NULL;
@ -827,12 +830,20 @@ GreStretchBltMask(
{ {
BitmapMask = DCMask->dclevel.pSurface; BitmapMask = DCMask->dclevel.pSurface;
if (BitmapMask && if (BitmapMask &&
(BitmapMask->SurfObj.sizlBitmap.cx != WidthSrc || (BitmapMask->SurfObj.sizlBitmap.cx < WidthSrc ||
BitmapMask->SurfObj.sizlBitmap.cy != HeightSrc)) 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; 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, XlateObj,
&DestRect, &DestRect,
&SourceRect, &SourceRect,
NULL, BitmapMask ? &MaskPoint : NULL,
&DCDest->eboFill.BrushObject, &DCDest->eboFill.BrushObject,
&BrushOrigin, &BrushOrigin,
ROP3_TO_ROP4(ROP)); ROP3_TO_ROP4(ROP));
@ -896,7 +907,9 @@ NtGdiStretchBlt(
HeightSrc, HeightSrc,
ROP, ROP,
dwBackColor, dwBackColor,
NULL); NULL,
0,
0);
} }