[WIN32K]
[reactos.git] / subsystems / win32 / win32k / objects / line.c
index 03069e3..180332f 100644 (file)
@@ -113,9 +113,6 @@ IntGdiLineTo(DC  *dc,
     }
     else
     {
     }
     else
     {
-       if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
-          DC_vUpdateLineBrush(dc);
-
         psurf = dc->dclevel.pSurface;
         if (NULL == psurf)
         {
         psurf = dc->dclevel.pSurface;
         if (NULL == psurf)
         {
@@ -250,6 +247,9 @@ IntGdiPolyline(DC      *dc,
     if (PATH_IsPathOpen(dc->dclevel))
         return PATH_Polyline(dc, pt, Count);
 
     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);
 
     if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
         DC_vUpdateFillBrush(dc);
 
@@ -265,8 +265,6 @@ IntGdiPolyline(DC      *dc,
         Points = EngAllocMem(0, Count * sizeof(POINT), TAG_COORD);
         if (Points != NULL)
         {
         Points = EngAllocMem(0, Count * sizeof(POINT), TAG_COORD);
         if (Points != NULL)
         {
-            DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds,
-                                    NULL, dc->rosdc.CombinedClip->rclBounds);
             psurf = dc->dclevel.pSurface;
             /* FIXME - psurf can be NULL!!!!
                Don't assert but handle this case gracefully! */
             psurf = dc->dclevel.pSurface;
             /* FIXME - psurf can be NULL!!!!
                Don't assert but handle this case gracefully! */
@@ -290,7 +288,6 @@ IntGdiPolyline(DC      *dc,
                                  ROP2_TO_MIX(pdcattr->jROP2));
 
             EngFreeMem(Points);
                                  ROP2_TO_MIX(pdcattr->jROP2));
 
             EngFreeMem(Points);
-            DC_vFinishBlit(dc, NULL);
         }
         else
         {
         }
         else
         {
@@ -298,6 +295,8 @@ IntGdiPolyline(DC      *dc,
         }
     }
 
         }
     }
 
+    DC_vFinishBlit(dc, NULL);
+
     return Ret;
 }
 
     return Ret;
 }
 
@@ -409,6 +408,9 @@ NtGdiLineTo(HDC  hDC,
 
     DC_vPrepareDCsForBlit(dc, rcLockRect, NULL, rcLockRect);
 
 
     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);
     Ret = IntGdiLineTo(dc, XEnd, YEnd);
 
     DC_vFinishBlit(dc, NULL);