[ros-diffs] [jgardou] 46965: [WIN32K] - Update brushes at the good moment in different places

jgardou at svn.reactos.org jgardou at svn.reactos.org
Tue Apr 20 22:23:15 CEST 2010


Author: jgardou
Date: Tue Apr 20 22:23:15 2010
New Revision: 46965

URL: http://svn.reactos.org/svn/reactos?rev=46965&view=rev
Log:
[WIN32K]
  - Update brushes at the good moment in different places

Modified:
    branches/reactos-yarotows/subsystems/win32/win32k/objects/arc.c
    branches/reactos-yarotows/subsystems/win32/win32k/objects/drawing.c
    branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c
    branches/reactos-yarotows/subsystems/win32/win32k/objects/line.c
    branches/reactos-yarotows/subsystems/win32/win32k/objects/path.c

Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/arc.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/objects/arc.c?rev=46965&r1=46964&r2=46965&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/arc.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/arc.c [iso-8859-1] Tue Apr 20 22:23:15 2010
@@ -219,12 +219,6 @@
 
   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 @@
   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 @@
   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,

Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/drawing.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/objects/drawing.c?rev=46965&r1=46964&r2=46965&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/drawing.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/drawing.c [iso-8859-1] Tue Apr 20 22:23:15 2010
@@ -64,14 +64,14 @@
 } 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 @@
  *
  *  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 @@
 	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 @@
  *  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 @@
 		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 @@
   pdcattr = dc->pdcattr;
 
   pbrush = BRUSH_LockBrush(pdcattr->hbrush);
-  if (!pbrush)   
+  if (!pbrush)
   {
       DPRINT1("FillArc Fail\n");
       SetLastWin32Error(ERROR_INTERNAL_ERROR);
@@ -1285,7 +1285,7 @@
                     (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End,
                      pbrush, Chord);
 
-  BRUSH_UnlockBrush(pbrush);    
+  BRUSH_UnlockBrush(pbrush);
   return ret;
 }
 
@@ -1329,7 +1329,7 @@
                 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 @@
                   INT Right,
                   INT Bottom,
                   INT Wellipse,
-                  INT Hellipse, 
+                  INT Hellipse,
                   PBRUSH pbrush)
 {
   Rect r;
@@ -1385,7 +1385,7 @@
                       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 @@
   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 @@
         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
   {

Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c?rev=46965&r1=46964&r2=46965&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] Tue Apr 20 22:23:15 2010
@@ -481,6 +481,12 @@
     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 @@
     }
 
     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 );

Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/line.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/objects/line.c?rev=46965&r1=46964&r2=46965&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/line.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/line.c [iso-8859-1] Tue Apr 20 22:23:15 2010
@@ -113,9 +113,6 @@
     }
     else
     {
-       if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
-          DC_vUpdateLineBrush(dc);
-
         psurf = dc->dclevel.pSurface;
         if (NULL == psurf)
         {
@@ -250,6 +247,9 @@
     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 @@
         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,13 +288,14 @@
                                  ROP2_TO_MIX(pdcattr->jROP2));
 
             EngFreeMem(Points);
-            DC_vFinishBlit(dc, NULL);
         }
         else
         {
             Ret = FALSE;
         }
     }
+
+    DC_vFinishBlit(dc, NULL);
 
     return Ret;
 }
@@ -408,6 +407,9 @@
     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);
 

Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/path.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/objects/path.c?rev=46965&r1=46964&r2=46965&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/path.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/path.c [iso-8859-1] Tue Apr 20 22:23:15 2010
@@ -2291,6 +2291,9 @@
      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))
@@ -2298,9 +2301,6 @@
 
   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 @@
      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))
@@ -2580,9 +2583,6 @@
 
   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);
@@ -2617,13 +2617,13 @@
      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);
 




More information about the Ros-diffs mailing list