[ros-diffs] [fireball] 42106: - Add polygon filling support to GrePolygon (previously only polygon outline was drawn).

fireball at svn.reactos.org fireball at svn.reactos.org
Mon Jul 20 23:30:35 CEST 2009


Author: fireball
Date: Mon Jul 20 23:30:34 2009
New Revision: 42106

URL: http://svn.reactos.org/svn/reactos?rev=42106&view=rev
Log:
- Add polygon filling support to GrePolygon (previously only polygon outline was drawn).

Modified:
    branches/arwinss/reactos/subsystems/win32/win32k/gre/polyfill.c
    branches/arwinss/reactos/subsystems/win32/win32k/gre/rect.c
    branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h
    branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild

Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/polyfill.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32/win32k/gre/polyfill.c?rev=42106&r1=42105&r2=42106&view=diff
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/gre/polyfill.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/gre/polyfill.c [iso-8859-1] Mon Jul 20 23:30:34 2009
@@ -27,7 +27,7 @@
  *                 21/2/2003: Created
  */
 
-#include <w32k.h>
+#include <win32k.h>
 
 #define NDEBUG
 #include <debug.h>
@@ -430,22 +430,21 @@
       BoundRect.right = x2;
 
       //DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
-      IntEngLineTo(&psurf->SurfObj,
-                   dc->rosdc.CombinedClip,
-                   BrushObj,
-                   x1,
-                   ScanLine,
-                   x2,
-                   ScanLine,
-                   &BoundRect, // Bounding rectangle
-                   RopMode); // MIX
+      GreLineTo(&psurf->SurfObj,
+                NULL,//dc->rosdc.CombinedClip,
+                BrushObj,
+                x1,
+                ScanLine,
+                x2,
+                ScanLine,
+                &BoundRect, // Bounding rectangle
+                RopMode); // MIX
     }
     pLeft = pRight->pNext;
     pRight = pLeft ? pLeft->pNext : NULL;
   }
 }
 
-static
 void
 APIENTRY
 POLYGONFILL_FillScanLineWinding(
@@ -503,15 +502,15 @@
 	BoundRect.right = x2;
 
 	//DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
-	IntEngLineTo(&psurf->SurfObj,
-                     dc->rosdc.CombinedClip,
-                     BrushObj,
-                     x1,
-                     ScanLine,
-                     x2,
-                     ScanLine,
-                     &BoundRect, // Bounding rectangle
-                     RopMode); // MIX
+	GreLineTo(&psurf->SurfObj,
+              NULL,//dc->rosdc.CombinedClip,
+              BrushObj,
+              x1,
+              ScanLine,
+              x2,
+              ScanLine,
+              &BoundRect, // Bounding rectangle
+              RopMode); // MIX
 
 	x1 = newx1;
 	x2 = newx2;
@@ -526,15 +525,15 @@
   BoundRect.right = x2;
 
   //DPRINT("Fill Line (%d, %d) to (%d, %d)\n",x1, ScanLine, x2, ScanLine);
-  IntEngLineTo(&psurf->SurfObj,
-               dc->rosdc.CombinedClip,
-               BrushObj,
-               x1,
-               ScanLine,
-               x2,
-               ScanLine,
-               &BoundRect, // Bounding rectangle
-               RopMode); // MIX
+  GreLineTo(&psurf->SurfObj,
+            NULL, //dc->rosdc.CombinedClip,
+            BrushObj,
+            x1,
+            ScanLine,
+            x2,
+            ScanLine,
+            &BoundRect, // Bounding rectangle
+            RopMode); // MIX
 }
 
 //When the fill mode is ALTERNATE, GDI fills the area between odd-numbered and
@@ -560,7 +559,7 @@
   FILL_EDGE_LIST *list = 0;
   FILL_EDGE *ActiveHead = 0;
   int ScanLine;
-  PDC_ATTR pdcattr = dc->pdcattr;
+  //PDC_ATTR pdcattr = dc->pdcattr;
   void
   (APIENTRY *FillScanLine)(
     PDC dc,
@@ -578,9 +577,9 @@
   if (NULL == list)
     return FALSE;
 
-  if ( WINDING == pdcattr->jFillMode )
-    FillScanLine = POLYGONFILL_FillScanLineWinding;
-  else /* default */
+  //if ( WINDING == pdcattr->jFillMode )
+    //FillScanLine = POLYGONFILL_FillScanLineWinding;
+  //else /* default */
     FillScanLine = POLYGONFILL_FillScanLineAlternate;
 
   /* For each Scanline from BoundRect.bottom to BoundRect.top,
@@ -599,12 +598,12 @@
   return TRUE;
 }
 
-BOOL FASTCALL
-IntFillPolygon(
+BOOL NTAPI
+GrepFillPolygon(
     PDC dc,
-    SURFACE *psurf,
+    SURFOBJ *psurf,
     BRUSHOBJ *BrushObj,
-    CONST PPOINT Points,
+    CONST POINT *Points,
     int Count,
     RECTL DestRect, 
     POINTL *BrushOrigin)
@@ -617,7 +616,7 @@
     //DPRINT("IntFillPolygon\n");
 
     /* Create Edge List. */
-    list = POLYGONFILL_MakeEdgeList(Points, Count);
+    list = POLYGONFILL_MakeEdgeList((PPOINT)Points, Count);
     /* DEBUG_PRINT_EDGELIST(list); */
     if (NULL == list)
         return FALSE;
@@ -647,17 +646,18 @@
                 LineRect.left = x1;
                 LineRect.right = x2;
 
-                IntEngBitBlt(&psurf->SurfObj,
-                                 NULL,
-                                 NULL,
-                                 dc->rosdc.CombinedClip,
-                                 NULL,
-                                 &LineRect,
-                                 NULL,
-                                 NULL,
-                                 BrushObj,
-                                 BrushOrigin,
-                                 ROP3_TO_ROP4(PATCOPY));
+                GrepBitBltEx(psurf,
+                             NULL,
+                             NULL,
+                             NULL,//dc->rosdc.CombinedClip,
+                             NULL,
+                             &LineRect,
+                             NULL,
+                             NULL,
+                             BrushObj,
+                             BrushOrigin,
+                             ROP3_TO_ROP4(PATCOPY),
+                             TRUE);
             }
             pLeft = pRight->pNext;
             pRight = pLeft ? pLeft->pNext : NULL;

Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/rect.c
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32/win32k/gre/rect.c?rev=42106&r1=42105&r2=42106&view=diff
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/gre/rect.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/gre/rect.c [iso-8859-1] Mon Jul 20 23:30:34 2009
@@ -100,7 +100,7 @@
     RECTL DestRect;
     MIX Mix;
     INT i;
-    //POINT BrushOrigin = {0, 0};
+    POINT BrushOrigin = {0, 0};
 
     // HACK
     DestRect.left = 0;
@@ -116,20 +116,13 @@
             //BrushOrigin = *((PPOINTL)&pbrFill->ptOrigin);
             //BrushOrigin.x += dc->ptlDCOrig.x;
             //BrushOrigin.y += dc->ptlDCOrig.y;
-#if 0
-            bRet = GrepBitBltEx(&pDC->pBitmap->SurfObj,
-                               NULL,
-                               NULL,
-                               NULL,//dc->rosdc.CombinedClip,
-                               NULL,
-                               &DestRect,
-                               NULL,
-                               NULL,
-                               &pDC->pFillBrush->BrushObj,
-                               &BrushOrigin,
-                               ROP3_TO_ROP4(PATCOPY),
-                               TRUE);
-#endif
+            GrepFillPolygon(pDC,
+                            &pDC->pBitmap->SurfObj,
+                            &pDC->pFillBrush->BrushObj,
+                            ptPoints,
+                            count,
+                            DestRect,
+                            &BrushOrigin);
         }
     }
 

Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h?rev=42106&r1=42105&r2=42106&view=diff
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h [iso-8859-1] Mon Jul 20 23:30:34 2009
@@ -80,6 +80,17 @@
           RECTL *RectBounds,
           MIX Mix);
 
+/* polyfill.c */
+BOOL NTAPI
+GrepFillPolygon(
+    PDC dc,
+    SURFOBJ *psurf,
+    BRUSHOBJ *BrushObj,
+    CONST POINT *Points,
+    int Count,
+    RECTL DestRect,
+    POINTL *BrushOrigin);
+
 /* rect.c */
 VOID NTAPI
 GreRectangle(PDC dc,

Modified: branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild
URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild?rev=42106&r1=42105&r2=42106&view=diff
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/win32k.rbuild [iso-8859-1] Mon Jul 20 23:30:34 2009
@@ -101,6 +101,7 @@
 		<file>gdiobj.c</file>
 		<file>lineto.c</file>
 		<file>palobj.c</file>
+		<file>polyfill.c</file>
 		<file>rect.c</file>
 		<file>surfobj.c</file>
 		<file>xformobj.c</file>



More information about the Ros-diffs mailing list