[ros-diffs] [gschneider] 44803: [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

gschneider at svn.reactos.org gschneider at svn.reactos.org
Tue Dec 29 19:21:00 CET 2009


Author: gschneider
Date: Tue Dec 29 19:21:00 2009
New Revision: 44803

URL: http://svn.reactos.org/svn/reactos?rev=44803&view=rev
Log:
[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

Modified:
    trunk/reactos/subsystems/win32/win32k/include/intgdi.h
    trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
    trunk/reactos/subsystems/win32/win32k/objects/bitblt.c

Modified: trunk/reactos/subsystems/win32/win32k/include/intgdi.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/include/intgdi.h?rev=44803&r1=44802&r2=44803&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/intgdi.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/intgdi.h [iso-8859-1] Tue Dec 29 19:21:00 2009
@@ -258,7 +258,9 @@
                   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 */
 

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c?rev=44803&r1=44802&r2=44803&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/cursoricon.c [iso-8859-1] Tue Dec 29 19:21:00 2009
@@ -1362,13 +1362,14 @@
                           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);

Modified: trunk/reactos/subsystems/win32/win32k/objects/bitblt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/bitblt.c?rev=44803&r1=44802&r2=44803&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Tue Dec 29 19:21:00 2009
@@ -703,7 +703,9 @@
     INT HeightSrc,
     DWORD ROP,
     IN DWORD dwBackColor,
-    HDC hDCMask)
+    HDC hDCMask,
+    INT XOriginMask,
+    INT YOriginMask)
 {
     PDC DCDest;
     PDC DCSrc  = NULL;
@@ -713,6 +715,7 @@
     SURFACE *BitmapMask = NULL;
     RECTL DestRect;
     RECTL SourceRect;
+    POINTL MaskPoint;
     BOOL Status = FALSE;
     EXLATEOBJ exlo;
     XLATEOBJ *XlateObj = NULL;
@@ -827,12 +830,20 @@
         {
             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 @@
                               XlateObj,
                               &DestRect,
                               &SourceRect,
-                              NULL,
+                              BitmapMask ? &MaskPoint : NULL,
                               &DCDest->eboFill.BrushObject,
                               &BrushOrigin,
                               ROP3_TO_ROP4(ROP));
@@ -896,7 +907,9 @@
                 HeightSrc,
                 ROP,
                 dwBackColor,
-                NULL);
+                NULL,
+                0,
+                0);
 }
 
 




More information about the Ros-diffs mailing list