[ros-diffs] [jimtabor] 37694: - Finnish up gdi wine pen cross test fixes. - Fix width issue with simple stock pens. - Fix Info DC building. This was made obvious with wine pen cross tests.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Thu Nov 27 21:51:19 CET 2008


Author: jimtabor
Date: Thu Nov 27 14:51:19 2008
New Revision: 37694

URL: http://svn.reactos.org/svn/reactos?rev=37694&view=rev
Log:
- Finnish up gdi wine pen cross test fixes.
- Fix width issue with simple stock pens.
- Fix Info DC building. This was made obvious with wine pen cross tests.


Modified:
    trunk/reactos/subsystems/win32/win32k/objects/dc.c
    trunk/reactos/subsystems/win32/win32k/objects/pen.c
    trunk/reactos/subsystems/win32/win32k/objects/stockobj.c

Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/dc.c?rev=37694&r1=37693&r2=37694&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Thu Nov 27 14:51:19 2008
@@ -60,7 +60,7 @@
 {
   PDC  NewDC, OrigDC;
   PDC_ATTR nDc_Attr, oDc_Attr;
-  HDC hNewDC, DisplayDC;
+  HDC hNewDC, DisplayDC = NULL;
   HRGN hVisRgn;
   UNICODE_STRING DriverName;
   DWORD Layout = 0;
@@ -145,6 +145,8 @@
   NewDC->DcLevel.flPath     = OrigDC->DcLevel.flPath;
   nDc_Attr->ulDirty_        = oDc_Attr->ulDirty_;
   nDc_Attr->iCS_CP          = oDc_Attr->iCS_CP;
+
+  NewDC->erclWindow = (RECTL){0,0,1,1};
 
   DC_UnlockDc(NewDC);
   DC_UnlockDc(OrigDC);
@@ -838,35 +840,30 @@
   NewDC->flGraphics  = PrimarySurface.DevInfo.flGraphicsCaps;
   NewDC->flGraphics2 = PrimarySurface.DevInfo.flGraphicsCaps2;
 
+  NewDC->DcLevel.hpal = NtGdiGetStockObject(DEFAULT_PALETTE);
+
+  nDc_Attr->jROP2 = R2_COPYPEN;
+
+  NewDC->erclWindow.top = NewDC->erclWindow.left = 0;
+  NewDC->erclWindow.right  = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulHorzRes;
+  NewDC->erclWindow.bottom = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulVertRes;
+  NewDC->DcLevel.flPath &= ~DCPATH_CLOCKWISE; // Default is CCW.
+
+  nDc_Attr->iCS_CP = ftGdiGetTextCharsetInfo(NewDC,NULL,0);
+
+  hVisRgn = NtGdiCreateRectRgn(0, 0, ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulHorzRes,
+                                     ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulVertRes);
+
   if (!CreateAsIC)
   {
-    NewDC->DcLevel.hpal = NtGdiGetStockObject(DEFAULT_PALETTE);
-
-    nDc_Attr->jROP2 = R2_COPYPEN;
-
-    NewDC->erclWindow.top = NewDC->erclWindow.left = 0;
-    NewDC->erclWindow.right  = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulHorzRes;
-    NewDC->erclWindow.bottom = ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulVertRes;
-    NewDC->DcLevel.flPath &= ~DCPATH_CLOCKWISE; // Default is CCW.
-
-    nDc_Attr->iCS_CP = ftGdiGetTextCharsetInfo(NewDC,NULL,0);
-
+    NewDC->pSurfInfo = NULL;
+//    NewDC->DcLevel.pSurface = 
     DC_UnlockDc( NewDC );
-
-    hVisRgn = NtGdiCreateRectRgn(0, 0, ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulHorzRes,
-                                 ((PGDIDEVICE)NewDC->pPDev)->GDIInfo.ulVertRes);
-    if (hVisRgn)
-    {
-      GdiSelectVisRgn(hNewDC, hVisRgn);
-      NtGdiDeleteObject(hVisRgn);
-    }
 
     /*  Initialize the DC state  */
     DC_InitDC(hNewDC);
     IntGdiSetTextColor(hNewDC, RGB(0, 0, 0));
-    IntGdiSetTextAlign(hNewDC, TA_TOP);
     IntGdiSetBkColor(hNewDC, RGB(255, 255, 255));
-    IntGdiSetBkMode(hNewDC, OPAQUE);
   }
   else
   {
@@ -877,8 +874,22 @@
        cannot accept a handle to an information context.
      */
     NewDC->DC_Type = DC_TYPE_INFO;
+//    NewDC->pSurfInfo = 
+    NewDC->DcLevel.pSurface = NULL;
+    nDc_Attr->crBackgroundClr = nDc_Attr->ulBackgroundClr = RGB(255, 255, 255);
+    nDc_Attr->crForegroundClr = RGB(0, 0, 0);
     DC_UnlockDc( NewDC );
   }
+
+  if (hVisRgn)
+  {
+     GdiSelectVisRgn(hNewDC, hVisRgn);
+     NtGdiDeleteObject(hVisRgn);
+  }
+
+  IntGdiSetTextAlign(hNewDC, TA_TOP);
+  IntGdiSetBkMode(hNewDC, OPAQUE);
+
   return hNewDC;
 }
 

Modified: trunk/reactos/subsystems/win32/win32k/objects/pen.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/pen.c?rev=37694&r1=37693&r2=37694&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/pen.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/pen.c [iso-8859-1] Thu Nov 27 14:51:19 2008
@@ -209,32 +209,34 @@
    PLOGPEN pLogPen;
    PEXTLOGPEN pExtLogPen;
    INT cbRetCount;
-   BOOLEAN isOldPen;
-
-   isOldPen = (pPenObject->flAttrs & GDIBRUSH_IS_OLDSTYLEPEN) > 0;
-   if ((pPenObject->ulPenStyle & PS_STYLE_MASK) == PS_NULL)
-   {
-      /* PS_NULL can be retrieved as LOGPEN or as EXTLOGPEN */
-      if (cbCount == sizeof(LOGPEN))
-      {
-         isOldPen = TRUE;
-      }
-      else if (cbCount == sizeof(EXTLOGPEN))
-      {
-         isOldPen = FALSE;
-      }
-   }
-
-   if (isOldPen)
+
+   if (pPenObject->flAttrs & GDIBRUSH_IS_OLDSTYLEPEN)
    {
       cbRetCount = sizeof(LOGPEN);
       if (pBuffer)
       {
+
          if (cbCount < cbRetCount) return 0;
-         pLogPen = (PLOGPEN)pBuffer;
-         pLogPen->lopnWidth = pPenObject->ptPenWidth;
-         pLogPen->lopnStyle = pPenObject->ulPenStyle;
-         pLogPen->lopnColor = pPenObject->BrushAttr.lbColor;
+
+         if ( (pPenObject->ulPenStyle & PS_STYLE_MASK) == PS_NULL && 
+               cbCount == sizeof(EXTLOGPEN))
+         {
+            pExtLogPen = (PEXTLOGPEN)pBuffer; 
+            pExtLogPen->elpPenStyle = pPenObject->ulPenStyle;
+            pExtLogPen->elpWidth = 0;
+            pExtLogPen->elpBrushStyle = pPenObject->ulStyle;
+            pExtLogPen->elpColor = pPenObject->BrushAttr.lbColor;
+            pExtLogPen->elpHatch = 0;
+            pExtLogPen->elpNumEntries = 0;
+            cbRetCount = sizeof(EXTLOGPEN);
+         }
+         else
+         {
+            pLogPen = (PLOGPEN)pBuffer;
+            pLogPen->lopnWidth = pPenObject->ptPenWidth;
+            pLogPen->lopnStyle = pPenObject->ulPenStyle;
+            pLogPen->lopnColor = pPenObject->BrushAttr.lbColor;
+         }
       }
    }
    else

Modified: trunk/reactos/subsystems/win32/win32k/objects/stockobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/stockobj.c?rev=37694&r1=37693&r2=37694&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/stockobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/stockobj.c [iso-8859-1] Thu Nov 27 14:51:19 2008
@@ -120,9 +120,9 @@
   HPEN hPen;
   PGDIBRUSHOBJ PenObject = PENOBJ_AllocPenWithHandle();
 
-  if ((!dwWidth) && (dwPenStyle & PS_STYLE_MASK) != PS_SOLID) dwWidth = 1;  
+  if ((dwPenStyle & PS_STYLE_MASK) == PS_NULL) dwWidth = 1;
    
-  PenObject->ptPenWidth.x = dwWidth;  
+  PenObject->ptPenWidth.x = abs(dwWidth);  
   PenObject->ptPenWidth.y = 0;  
   PenObject->ulPenStyle = dwPenStyle;  
   PenObject->BrushAttr.lbColor = ulColor;  



More information about the Ros-diffs mailing list