[YAROTOWS] Reintegrate the branch. For a brighter future.
[reactos.git] / reactos / subsystems / win32 / win32k / objects / line.c
index 2c5355b..28ff28a 100644 (file)
@@ -17,7 +17,7 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <w32k.h>
+#include <win32k.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -30,7 +30,8 @@ BOOL FASTCALL
 IntGdiMoveToEx(DC      *dc,
                int     X,
                int     Y,
-               LPPOINT Point)
+               LPPOINT Point,
+               BOOL    BypassPath)
 {
     BOOL  PathIsOpen;
     PDC_ATTR pdcattr = dc->pdcattr;
@@ -54,6 +55,8 @@ IntGdiMoveToEx(DC      *dc,
     CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
     pdcattr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
 
+    if (BypassPath) return TRUE;
+
     PathIsOpen = PATH_IsPathOpen(dc->dclevel);
 
     if ( PathIsOpen )
@@ -110,9 +113,6 @@ IntGdiLineTo(DC  *dc,
     }
     else
     {
-       if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
-          DC_vUpdateLineBrush(dc);
-
         psurf = dc->dclevel.pSurface;
         if (NULL == psurf)
         {
@@ -247,6 +247,9 @@ IntGdiPolyline(DC      *dc,
     if (PATH_IsPathOpen(dc->dclevel))
         return PATH_Polyline(dc, pt, Count);
 
+    DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds,
+                            NULL, dc->rosdc.CombinedClip->rclBounds);
+
     if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
         DC_vUpdateFillBrush(dc);
 
@@ -292,6 +295,8 @@ IntGdiPolyline(DC      *dc,
         }
     }
 
+    DC_vFinishBlit(dc, NULL);
+
     return Ret;
 }
 
@@ -373,6 +378,7 @@ NtGdiLineTo(HDC  hDC,
 {
     DC *dc;
     BOOL Ret;
+    RECT rcLockRect ;
 
     dc = DC_LockDc(hDC);
     if (!dc)
@@ -387,8 +393,28 @@ NtGdiLineTo(HDC  hDC,
         return TRUE;
     }
 
+    rcLockRect.left = dc->pdcattr->ptlCurrent.x;
+    rcLockRect.top = dc->pdcattr->ptlCurrent.y;
+    rcLockRect.right = XEnd;
+    rcLockRect.bottom = YEnd;
+
+    IntLPtoDP(dc, &rcLockRect, 2);
+
+    /* The DCOrg is in device coordinates */
+    rcLockRect.left += dc->ptlDCOrig.x;
+    rcLockRect.top += dc->ptlDCOrig.y;
+    rcLockRect.right += dc->ptlDCOrig.x;
+    rcLockRect.bottom += dc->ptlDCOrig.y;
+
+    DC_vPrepareDCsForBlit(dc, rcLockRect, NULL, rcLockRect);
+
+    if (dc->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
+        DC_vUpdateLineBrush(dc);
+
     Ret = IntGdiLineTo(dc, XEnd, YEnd);
 
+    DC_vFinishBlit(dc, NULL);
+
     DC_UnlockDc(dc);
     return Ret;
 }
@@ -437,7 +463,7 @@ NtGdiPolyDraw(
         {
             if ( lpbTypes[i] == PT_MOVETO )
             {
-                IntGdiMoveToEx( dc, lppt[i].x, lppt[i].y, NULL );
+                IntGdiMoveToEx( dc, lppt[i].x, lppt[i].y, NULL, FALSE );
                 lastmove.x = pdcattr->ptlCurrent.x;
                 lastmove.y = pdcattr->ptlCurrent.y;
             }