- Copy the source rectangle after checking it
[reactos.git] / reactos / subsystems / win32 / win32k / eng / stretchblt.c
index 8b1290d..9973944 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * COPYRIGHT:        See COPYING in the top level directory
- * PROJECT:          ReactOS kernel
+ * PROJECT:          ReactOS Win32 kernelmode subsystem
  * PURPOSE:          GDI stretch blt functions
  * FILE:             subsystems/win32/win32k/eng/stretchblt.c
  * PROGRAMER:        Jason Filby
@@ -73,7 +73,7 @@ CallDibStretchBlt(SURFOBJ* psoDest,
     bResult = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_StretchBlt(
                psoDest, psoSource, Mask, PatternSurface,
                OutputRect, InputRect, MaskOrigin, pbo, &RealBrushOrigin,
-               ColorTranslation, NULL, Rop4);
+               ColorTranslation, Rop4);
 
     /* Pattern brush */
     if (psurfPattern)
@@ -160,13 +160,13 @@ EngStretchBltROP(
         OutputRect.bottom = prclDest->top;
     }
 
-    InputRect = *prclSrc;
     if (UsesSource)
     {
         if (NULL == prclSrc)
         {
             return FALSE;
         }
+        InputRect = *prclSrc;
 
         if (! IntEngEnter(&EnterLeaveSource, psoSource, &InputRect, TRUE,
                           &Translate, &psoInput))
@@ -179,6 +179,13 @@ EngStretchBltROP(
         InputRect.top += Translate.y;
         InputRect.bottom += Translate.y;
     }
+    else
+    {
+        InputRect.left = 0;
+        InputRect.right = OutputRect.right - OutputRect.left;
+        InputRect.top = 0;
+        InputRect.bottom = OutputRect.bottom - OutputRect.top;
+    }
 
     if (NULL != ClipRegion)
     {