[YAROTOWS] Reintegrate the branch. For a brighter future.
[reactos.git] / reactos / subsystems / win32 / win32k / eng / stretchblt.c
index 9973944..a6f3d4f 100644 (file)
@@ -6,7 +6,7 @@
  * PROGRAMER:        Jason Filby
  */
 
-#include <w32k.h>
+#include <win32k.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -389,7 +389,7 @@ IntEngStretchBlt(SURFOBJ *psoDest,
 {
     BOOLEAN ret;
     COLORADJUSTMENT ca;
-    POINT MaskOrigin;
+    POINTL MaskOrigin = {0, 0};
     SURFACE *psurfDest;
     SURFACE *psurfSource = NULL;
     RECTL InputClippedRect;
@@ -456,54 +456,54 @@ IntEngStretchBlt(SURFOBJ *psoDest,
 
     if (pMaskOrigin != NULL)
     {
-        MaskOrigin.x = pMaskOrigin->x; MaskOrigin.y = pMaskOrigin->y;
+        MaskOrigin.x = pMaskOrigin->x;
+        MaskOrigin.y = pMaskOrigin->y;
     }
 
     /* No success yet */
     ret = FALSE;
-    SURFACE_LockBitmapBits(psurfDest);
-    MouseSafetyOnDrawStart(psoDest, OutputRect.left, OutputRect.top,
-                           OutputRect.right, OutputRect.bottom);
 
     if (UsesSource)
     {
         psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
-        if (psoSource != psoDest)
-        {
-            SURFACE_LockBitmapBits(psurfSource);
-        }
-        MouseSafetyOnDrawStart(psoSource, InputRect.left, InputRect.top,
-                               InputRect.right, InputRect.bottom);
     }
 
     /* Prepare color adjustment */
 
     /* Call the driver's DrvStretchBlt if available */
-    if (psurfDest->flHooks & HOOK_STRETCHBLTROP)
+    if (psurfDest->flags & HOOK_STRETCHBLTROP)
     {
         /* Drv->StretchBltROP (look at http://www.osronline.com/ddkx/graphics/ddifncs_0z3b.htm ) */
-        // FIXME: MaskOrigin is always NULL !
-        ret = GDIDEVFUNCS(psoDest).StretchBltROP(psoDest, (UsesSource) ? psoSource : NULL, MaskSurf, ClipRegion, ColorTranslation,
-                  &ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, pbo, ROP);
+        ret = GDIDEVFUNCS(psoDest).StretchBltROP(psoDest,
+                                                 (UsesSource) ? psoSource : NULL,
+                                                 MaskSurf,
+                                                 ClipRegion,
+                                                 ColorTranslation,
+                                                 &ca, BrushOrigin,
+                                                 &OutputRect,
+                                                 &InputRect,
+                                                 &MaskOrigin,
+                                                 COLORONCOLOR,
+                                                 pbo,
+                                                 ROP);
     }
 
     if (! ret)
     {
-        // FIXME: see previous fixme
-        ret = EngStretchBltROP(psoDest, (UsesSource) ? psoSource : NULL, MaskSurf, ClipRegion, ColorTranslation,
-                            &ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, pbo, ROP);
-    }
-
-    if (UsesSource)
-    {
-        MouseSafetyOnDrawEnd(psoSource);
-        if (psoSource != psoDest)
-        {
-            SURFACE_UnlockBitmapBits(psurfSource);
-        }
+        ret = EngStretchBltROP(psoDest,
+                               (UsesSource) ? psoSource : NULL,
+                               MaskSurf,
+                               ClipRegion,
+                               ColorTranslation,
+                               &ca,
+                               BrushOrigin,
+                               &OutputRect,
+                               &InputRect,
+                               &MaskOrigin,
+                               COLORONCOLOR,
+                               pbo,
+                               ROP);
     }
-    MouseSafetyOnDrawEnd(psoDest);
-    SURFACE_UnlockBitmapBits(psurfDest);
 
     return ret;
 }