[ros-diffs] [gschneider] 37620: - Move slightly changed PS_ALTERNATE and PS_INSIDEFRAME checks from win32k to gdi32 - Don't restrict the width of PS_SOLID pens - Fixes 25 gdi32 pen winetests - Pen types left tbd: PS_NULL (problems in GetObject and ExtCreatePen) and PS_ALTNATE (EngLineTo/StrokePath does not support bitmap pens)

gschneider at svn.reactos.org gschneider at svn.reactos.org
Mon Nov 24 19:40:46 CET 2008


Author: gschneider
Date: Mon Nov 24 12:40:46 2008
New Revision: 37620

URL: http://svn.reactos.org/svn/reactos?rev=37620&view=rev
Log:
- Move slightly changed PS_ALTERNATE and PS_INSIDEFRAME checks from win32k to gdi32
- Don't restrict the width of PS_SOLID pens
- Fixes 25 gdi32 pen winetests
- Pen types left tbd: PS_NULL (problems in GetObject and ExtCreatePen) and PS_ALTNATE (EngLineTo/StrokePath does not support bitmap pens)

Modified:
    trunk/reactos/dll/win32/gdi32/objects/brush.c
    trunk/reactos/subsystems/win32/win32k/objects/pen.c

Modified: trunk/reactos/dll/win32/gdi32/objects/brush.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/brush.c?rev=37620&r1=37619&r2=37620&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/brush.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/brush.c [iso-8859-1] Mon Nov 24 12:40:46 2008
@@ -29,6 +29,18 @@
          SetLastError(ERROR_INVALID_PARAMETER);
          return 0;
       }
+   }
+   else if ((dwPenStyle & PS_STYLE_MASK) == PS_INSIDEFRAME &&
+            (dwPenStyle & PS_TYPE_MASK) != PS_GEOMETRIC)
+   {
+      SetLastError(ERROR_INVALID_PARAMETER);
+      return 0;
+   }
+   else if ((dwPenStyle & PS_STYLE_MASK) == PS_ALTERNATE &&
+            (dwPenStyle & PS_TYPE_MASK) != PS_COSMETIC)
+   {
+      SetLastError(ERROR_INVALID_PARAMETER);
+      return 0;
    }
    else
    {

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=37620&r1=37619&r2=37620&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] Mon Nov 24 12:40:46 2008
@@ -79,7 +79,7 @@
    hPen = PenObject->BaseObject.hHmgr;
 
    // If nWidth is zero, the pen is a single pixel wide, regardless of the current transformation.
-   if ((bOldStylePen) && (!dwWidth)) dwWidth = 1;
+   if ((bOldStylePen) && (!dwWidth) && (dwPenStyle & PS_STYLE_MASK) != PS_SOLID) dwWidth = 1;
 
    PenObject->ptPenWidth.x = dwWidth;
    PenObject->ptPenWidth.y = 0;
@@ -108,8 +108,6 @@
          break;
 
       case PS_ALTERNATE:
-         /* PS_ALTERNATE is applicable only for cosmetic pens */
-         if ((dwPenStyle & PS_TYPE_MASK) == PS_GEOMETRIC) goto ExitCleanup;
          PenObject->flAttrs |= GDIBRUSH_IS_BITMAP;
          PenObject->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternAlternate);
          break;
@@ -135,9 +133,6 @@
          break;
 
       case PS_INSIDEFRAME:
-         /* FIXME: does it need some additional work? */
-         /* PS_INSIDEFRAME is applicable only for geometric pens */
-         if ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) goto ExitCleanup;
          PenObject->flAttrs |= (GDIBRUSH_IS_SOLID|GDIBRUSH_IS_INSIDEFRAME);
          break;
 



More information about the Ros-diffs mailing list