[WIN32K]
authorJérôme Gardou <jerome.gardou@reactos.org>
Tue, 20 Apr 2010 20:23:15 +0000 (20:23 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Tue, 20 Apr 2010 20:23:15 +0000 (20:23 +0000)
  - Update brushes at the good moment in different places

svn path=/branches/reactos-yarotows/; revision=46965

subsystems/win32/win32k/objects/arc.c
subsystems/win32/win32k/objects/drawing.c
subsystems/win32/win32k/objects/fillshap.c
subsystems/win32/win32k/objects/line.c
subsystems/win32/win32k/objects/path.c

index a28bb46..136d730 100644 (file)
@@ -219,12 +219,6 @@ IntGdiArcInternal(
 
   pdcattr = dc->pdcattr;
 
-  if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
-    DC_vUpdateFillBrush(dc);
-
-  if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
-    DC_vUpdateLineBrush(dc);
-
   if (arctype == GdiTypeArcTo)
   {
     if (dc->dclevel.flPath & DCPATH_CLOCKWISE)
@@ -331,6 +325,10 @@ NtGdiAngleArc(
   worker1.l = dwSweepAngle;
   DC_vPrepareDCsForBlit(pDC, pDC->rosdc.CombinedClip->rclBounds,
                            NULL, pDC->rosdc.CombinedClip->rclBounds);
+  if (pDC->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
+    DC_vUpdateFillBrush(pDC);
+  if (pDC->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
+    DC_vUpdateLineBrush(pDC);
   Ret = IntGdiAngleArc( pDC, x, y, dwRadius, worker.f, worker1.f);
   DC_vFinishBlit(pDC, NULL);
   DC_UnlockDc( pDC );
@@ -370,6 +368,12 @@ NtGdiArcInternal(
   DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds,
                             NULL, dc->rosdc.CombinedClip->rclBounds);
 
+  if (dc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
+    DC_vUpdateFillBrush(dc);
+
+  if (dc->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
+    DC_vUpdateLineBrush(dc);
+
   Ret = IntGdiArcInternal(
                   arctype,
                   dc,
index 073ee1a..2968ee8 100755 (executable)
@@ -64,14 +64,14 @@ typedef struct _Rect
 } Rect, *PRect;
 
 int FASTCALL IntFillRect(DC *dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush, BOOL Pen);
-int FASTCALL app_fill_rect(DC *dc, Rect r, PBRUSH pbrush, BOOL Pen);
+//int FASTCALL app_fill_rect(DC *dc, Rect r, PBRUSH pbrush, BOOL Pen);
 
 static
 POINT
 INTERNAL_CALL
 app_new_point(int x, int y)
 {
-       POINT p;        
+       POINT p;
        p.x = x;
        p.y = y;
        return p;
@@ -332,7 +332,7 @@ app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
  *
  *  The draw_arc algorithm is based on draw_ellipse, but unlike
  *  that algorithm is not symmetric in the general case, since
- *  an angular portion is clipped from the shape. 
+ *  an angular portion is clipped from the shape.
  *  This clipping is performed by keeping track of two hypothetical
  *  lines joining the centre point to the enclosing rectangle,
  *  at the angles start_angle and end_angle, using a line-intersection
@@ -376,7 +376,7 @@ app_fill_arc_rect(DC *g,
        rise2 = p2.y - p0.y;
        run2  = p2.x - p0.x;
 
-       if (r.y <= p0.y) // 
+       if (r.y <= p0.y) //
         {
                /* in top half of arc ellipse */
 
@@ -599,7 +599,7 @@ app_fill_arc_rect(DC *g,
  *  between an outer and inner ellipse, and also the draw_arc and
  *  fill_arc operations which additionally clip drawing between
  *  a start_angle and an end_angle.
- *  
+ *
  */
 static
 int
@@ -912,7 +912,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL
                r1.height = r1.y+r1.height-r2.y;
                r1.y = r2.y;
                while (r1.height > 0) {
-                       result &= app_fill_arc_rect(g, 
+                       result &= app_fill_arc_rect(g,
                                rect(r1.x, r1.y, r1.width, 1),
                                p0, p1, p2, start_angle, end_angle, pbrush, FALSE);
                        r1.y += 1;
@@ -1273,7 +1273,7 @@ IntFillArc( PDC dc,
   pdcattr = dc->pdcattr;
 
   pbrush = BRUSH_LockBrush(pdcattr->hbrush);
-  if (!pbrush)   
+  if (!pbrush)
   {
       DPRINT1("FillArc Fail\n");
       SetLastWin32Error(ERROR_INTERNAL_ERROR);
@@ -1285,7 +1285,7 @@ IntFillArc( PDC dc,
                     (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End,
                      pbrush, Chord);
 
-  BRUSH_UnlockBrush(pbrush);    
+  BRUSH_UnlockBrush(pbrush);
   return ret;
 }
 
@@ -1329,7 +1329,7 @@ IntFillEllipse( PDC dc,
                 INT XLeft,
                 INT YLeft,
                 INT Width,
-                INT Height, 
+                INT Height,
                 PBRUSH pbrush)
 {
   return (BOOL)app_fill_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush);
@@ -1343,7 +1343,7 @@ IntFillRoundRect( PDC dc,
                   INT Right,
                   INT Bottom,
                   INT Wellipse,
-                  INT Hellipse, 
+                  INT Hellipse,
                   PBRUSH pbrush)
 {
   Rect r;
@@ -1385,7 +1385,7 @@ IntFillRoundRect( PDC dc,
                       270, 360, pbrush,FALSE);
 
      app_fill_arc(dc, rect(r.x+r.width-rx-rx, r.y, rx+rx, ry+ry),
-                      0, 90, pbrush,FALSE);   
+                      0, 90, pbrush,FALSE);
   }
   if (Wellipse < r.width)
   {
@@ -1419,7 +1419,7 @@ IntDrawRoundRect( PDC dc,
   r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top));
   rx = Wellipse/2;
   ry = Hellipse/2;
-  
+
   if (Wellipse > r.width)
   {
      if (Hellipse > r.height) // > W > H
@@ -1437,7 +1437,7 @@ IntDrawRoundRect( PDC dc,
         app_draw_arc(dc, rect(r.x, r.y, Wellipse - 1, r.height - 1),
                          90, 270, pbrushPen, FALSE);
         app_draw_arc(dc, rect(Right - Wellipse, r.y, Wellipse - 1, r.height - 1),
-                         270, 90, pbrushPen, FALSE);        
+                         270, 90, pbrushPen, FALSE);
   }
   else // < W < H
   {
index ad25bd6..5fd09fd 100644 (file)
@@ -481,6 +481,12 @@ NtGdiPolyPolyDraw( IN HDC hDC,
     DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds,
                             NULL, dc->rosdc.CombinedClip->rclBounds);
 
+    if (dc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
+        DC_vUpdateFillBrush(dc);
+
+    if (dc->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
+        DC_vUpdateLineBrush(dc);
+
     /* Perform the actual work */
     switch (iFunc)
     {
@@ -681,6 +687,12 @@ NtGdiRectangle(HDC  hDC,
     }
 
     DC_vPrepareDCsForBlit(dc, rect, NULL, rect);
+    if (dc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
+        DC_vUpdateFillBrush(dc);
+
+    if (dc->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
+        DC_vUpdateLineBrush(dc);
+
     ret = IntRectangle ( dc, LeftRect, TopRect, RightRect, BottomRect );
     DC_vFinishBlit(dc, NULL);
     DC_UnlockDc ( dc );
index 03069e3..180332f 100644 (file)
@@ -113,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)
         {
@@ -250,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);
 
@@ -265,8 +265,6 @@ IntGdiPolyline(DC      *dc,
         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! */
@@ -290,7 +288,6 @@ IntGdiPolyline(DC      *dc,
                                  ROP2_TO_MIX(pdcattr->jROP2));
 
             EngFreeMem(Points);
-            DC_vFinishBlit(dc, NULL);
         }
         else
         {
@@ -298,6 +295,8 @@ IntGdiPolyline(DC      *dc,
         }
     }
 
+    DC_vFinishBlit(dc, NULL);
+
     return Ret;
 }
 
@@ -409,6 +408,9 @@ NtGdiLineTo(HDC  hDC,
 
     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);
index 8d15f8f..927cfd7 100644 (file)
@@ -2291,6 +2291,9 @@ NtGdiFillPath(HDC  hDC)
      return FALSE;
   }
 
+  DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds,
+                            NULL, dc->rosdc.CombinedClip->rclBounds);
+
   pdcattr = dc->pdcattr;
 
   if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
@@ -2299,9 +2302,6 @@ NtGdiFillPath(HDC  hDC)
   if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
       DC_vUpdateFillBrush(dc);
 
-  DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds,
-                            NULL, dc->rosdc.CombinedClip->rclBounds);
-
   ret = PATH_FillPath( dc, pPath );
   if ( ret )
   {
@@ -2573,6 +2573,9 @@ NtGdiStrokeAndFillPath(HDC hDC)
      return FALSE;
   }
 
+  DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds,
+                            NULL, pDc->rosdc.CombinedClip->rclBounds);
+
   pdcattr = pDc->pdcattr;
 
   if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
@@ -2581,9 +2584,6 @@ NtGdiStrokeAndFillPath(HDC hDC)
   if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
     DC_vUpdateLineBrush(pDc);
 
-  DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds,
-                            NULL, pDc->rosdc.CombinedClip->rclBounds);
-
   bRet = PATH_FillPath(pDc, pPath);
   if (bRet) bRet = PATH_StrokePath(pDc, pPath);
   if (bRet) PATH_EmptyPath(pPath);
@@ -2617,14 +2617,14 @@ NtGdiStrokePath(HDC hDC)
      return FALSE;
   }
 
+  DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds,
+                            NULL, pDc->rosdc.CombinedClip->rclBounds);
+
   pdcattr = pDc->pdcattr;
 
   if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
      DC_vUpdateLineBrush(pDc);
 
-  DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds,
-                            NULL, pDc->rosdc.CombinedClip->rclBounds);
-
   bRet = PATH_StrokePath(pDc, pPath);
 
   DC_vFinishBlit(pDc, NULL);