Author: tkreuzer
Date: Wed Feb 11 21:33:50 2015
New Revision: 66227
URL:
http://svn.reactos.org/svn/reactos?rev=66227&view=rev
Log:
[WIN32K]
Improve naming of some BRUSH fields and set the correct fields to the correct values
(ulStyle was not for the brush style, but the hatch style!)
Modified:
trunk/reactos/win32ss/gdi/eng/engbrush.c
trunk/reactos/win32ss/gdi/ntgdi/arc.c
trunk/reactos/win32ss/gdi/ntgdi/brush.c
trunk/reactos/win32ss/gdi/ntgdi/brush.h
trunk/reactos/win32ss/gdi/ntgdi/drawing.c
trunk/reactos/win32ss/gdi/ntgdi/fillshap.c
trunk/reactos/win32ss/gdi/ntgdi/pen.c
trunk/reactos/win32ss/gdi/ntgdi/stockobj.c
Modified: trunk/reactos/win32ss/gdi/eng/engbrush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engbrush.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] Wed Feb 11 21:33:50 2015
@@ -312,8 +312,8 @@
if (pbr->flAttrs & BR_IS_HATCH)
{
/* Get the hatch brush pattern from the PDEV */
- hbmPattern = (HBITMAP)ppdev->ahsurf[pbr->ulStyle];
- iHatch = pbr->ulStyle;
+ hbmPattern = (HBITMAP)ppdev->ahsurf[pbr->iHatch];
+ iHatch = pbr->iHatch;
}
else
{
Modified: trunk/reactos/win32ss/gdi/ntgdi/arc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/arc.c?re…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] Wed Feb 11 21:33:50 2015
@@ -79,7 +79,7 @@
return FALSE;
}
- PenOrigWidth = PenWidth = pbrPen->ptPenWidth.x;
+ PenOrigWidth = PenWidth = pbrPen->lWidth;
if (pbrPen->ulPenStyle == PS_NULL) PenWidth = 0;
if (pbrPen->ulPenStyle == PS_INSIDEFRAME)
@@ -93,7 +93,7 @@
}
if (!PenWidth) PenWidth = 1;
- pbrPen->ptPenWidth.x = PenWidth;
+ pbrPen->lWidth = PenWidth;
RectBounds.left = Left;
RectBounds.right = Right;
@@ -181,7 +181,7 @@
if (arctype == GdiTypeChord)
PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY,
dc->eboLine);
- pbrPen->ptPenWidth.x = PenOrigWidth;
+ pbrPen->lWidth = PenOrigWidth;
PEN_ShareUnlockPen(pbrPen);
DPRINT("IntArc Exit.\n");
return ret;
Modified: trunk/reactos/win32ss/gdi/ntgdi/brush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/brush.c?…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/brush.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/brush.c [iso-8859-1] Wed Feb 11 21:33:50 2015
@@ -181,7 +181,7 @@
else if (pbrush->flAttrs & BR_IS_HATCH)
{
plogbrush->lbStyle = BS_HATCHED;
- plogbrush->lbHatch = pbrush->ulStyle;
+ plogbrush->lbHatch = pbrush->iHatch;
}
else if (pbrush->flAttrs & BR_IS_DIB)
{
@@ -293,7 +293,7 @@
pbrush->flAttrs |= BR_IS_HATCH;
pbrush->BrushAttr.lbColor = Color & 0xFFFFFF;
- pbrush->ulStyle = Style;
+ pbrush->iHatch = Style;
GDIOBJ_vUnlockObject(&pbrush->BaseObject);
Modified: trunk/reactos/win32ss/gdi/ntgdi/brush.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/brush.h?…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/brush.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/brush.h [iso-8859-1] Wed Feb 11 21:33:50 2015
@@ -13,31 +13,40 @@
*/
typedef struct _BRUSH
{
- /* Header for all gdi objects in the handle table.
- Do not (re)move this. */
- BASEOBJECT BaseObject;
+ /* Header for all gdi objects in the handle table.
+ Do not (re)move this. */
+ BASEOBJECT BaseObject;
- ULONG ulStyle;
- HBITMAP hbmPattern;
- HBITMAP hbmClient;
- ULONG flAttrs;
+ ULONG iHatch; // This is not the brush style, but the hatch style!
+ HBITMAP hbmPattern;
+ HBITMAP hbmClient;
+ ULONG flAttrs;
- ULONG ulBrushUnique;
- BRUSH_ATTR *pBrushAttr; // Just like DC_ATTR, pointer to user data
- BRUSH_ATTR BrushAttr; // " " DCOBJ, internal if pBrushAttr == Zero
- POINT ptOrigin;
- ULONG bCacheGrabbed;
- COLORREF crBack;
- COLORREF crFore;
- ULONG ulPalTime;
- ULONG ulSurfTime;
- PVOID ulRealization;
- //ULONG Unknown4C[3];
- POINT ptPenWidth;
- ULONG ulPenStyle;
- DWORD *pStyle;
- ULONG dwStyleCount;
- //ULONG Unknown6C;
+ ULONG ulBrushUnique;
+ BRUSH_ATTR *pBrushAttr; // Pointer to the currently active brush attribute
+ BRUSH_ATTR BrushAttr; // Internal brush attribute for global brushes
+ POINT ptOrigin;
+ ULONG bCacheGrabbed;
+ COLORREF crBack;
+ COLORREF crFore;
+ ULONG ulPalTime;
+ ULONG ulSurfTime;
+ PVOID pvRBrush;
+ HDEV hdev;
+ //DWORD unk054;
+ LONG lWidth;
+ FLOAT eWidth;
+ ULONG ulPenStyle;
+ DWORD *pStyle;
+ ULONG dwStyleCount;
+ BYTE jJoin; // 0x06c Join styles for geometric wide lines
+ BYTE jEndCap; // end cap style for a geometric wide line
+ //WORD unk06e; // 0x06e
+ INT iBrushStyle; // 0x070
+ //PREGION prgn; // 0x074
+ //DWORD unk078; // 0x078
+ DWORD unk07c; // 0x07c
+ LIST_ENTRY ListHead; // 0x080
} BRUSH, *PBRUSH;
typedef struct _EBRUSHOBJ
@@ -91,8 +100,17 @@
#define BRUSH_ShareLockBrush(hBrush) ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush,
GDI_OBJECT_TYPE_BRUSH))
#define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush)
-INT FASTCALL BRUSH_GetObject (PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer);
-VOID NTAPI BRUSH_vCleanup(PVOID ObjectBody);
+INT
+FASTCALL
+BRUSH_GetObject(
+ PBRUSH GdiObject,
+ INT Count,
+ LPLOGBRUSH Buffer);
+
+VOID
+NTAPI
+BRUSH_vCleanup(
+ PVOID ObjectBody);
extern HSURF gahsurfHatch[HS_DDI_MAX];
Modified: trunk/reactos/win32ss/gdi/ntgdi/drawing.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/drawing.…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/drawing.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/drawing.c [iso-8859-1] Wed Feb 11 21:33:50 2015
@@ -139,7 +139,7 @@
int d2xt = b2+b2;
int d2yt = a2+a2;
- int w = pbrush->ptPenWidth.x;
+ int w = pbrush->lWidth;
/* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */
@@ -983,7 +983,7 @@
int d2xt = b2+b2;
int d2yt = a2+a2;
- int w = pbrushPen->ptPenWidth.x;
+ int w = pbrushPen->lWidth;
/* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */
@@ -1470,7 +1470,7 @@
{
Rect r;
int rx, ry; /* Radius in x and y directions */
- int w = pbrushPen->ptPenWidth.x;
+ int w = pbrushPen->lWidth;
r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top));
rx = Wellipse/2;
Modified: trunk/reactos/win32ss/gdi/ntgdi/fillshap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/fillshap…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] Wed Feb 11 21:33:50 2015
@@ -252,7 +252,7 @@
return FALSE;
}
- PenOrigWidth = PenWidth = pbrush->ptPenWidth.x;
+ PenOrigWidth = PenWidth = pbrush->lWidth;
if (pbrush->ulPenStyle == PS_NULL) PenWidth = 0;
if (pbrush->ulPenStyle == PS_INSIDEFRAME)
@@ -266,7 +266,7 @@
}
if (!PenWidth) PenWidth = 1;
- pbrush->ptPenWidth.x = PenWidth;
+ pbrush->lWidth = PenWidth;
RectBounds.left = Left;
RectBounds.right = Right;
@@ -330,7 +330,7 @@
DC_vFinishBlit(dc, NULL);
}
- pbrush->ptPenWidth.x = PenOrigWidth;
+ pbrush->lWidth = PenOrigWidth;
PEN_ShareUnlockPen(pbrush);
DC_UnlockDc(dc);
DPRINT("Ellipse Exit.\n");
@@ -760,7 +760,7 @@
return FALSE;
}
- PenOrigWidth = PenWidth = pbrLine->ptPenWidth.x;
+ PenOrigWidth = PenWidth = pbrLine->lWidth;
if (pbrLine->ulPenStyle == PS_NULL) PenWidth = 0;
if (pbrLine->ulPenStyle == PS_INSIDEFRAME)
@@ -774,7 +774,7 @@
}
if (!PenWidth) PenWidth = 1;
- pbrLine->ptPenWidth.x = PenWidth;
+ pbrLine->lWidth = PenWidth;
RectBounds.left = Left;
RectBounds.top = Top;
@@ -829,7 +829,7 @@
}
- pbrLine->ptPenWidth.x = PenOrigWidth;
+ pbrLine->lWidth = PenOrigWidth;
PEN_ShareUnlockPen(pbrLine);
return ret;
}
Modified: trunk/reactos/win32ss/gdi/ntgdi/pen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/pen.c?re…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/pen.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/pen.c [iso-8859-1] Wed Feb 11 21:33:50 2015
@@ -120,11 +120,11 @@
if ((bOldStylePen) && (!dwWidth) && ((dwPenStyle & PS_STYLE_MASK)
!= PS_SOLID))
dwWidth = 1;
- pbrushPen->ptPenWidth.x = dwWidth;
- pbrushPen->ptPenWidth.y = 0;
+ pbrushPen->lWidth = dwWidth;
+ pbrushPen->eWidth = (FLOAT)pbrushPen->lWidth;
pbrushPen->ulPenStyle = dwPenStyle;
pbrushPen->BrushAttr.lbColor = ulColor;
- pbrushPen->ulStyle = ulBrushStyle;
+ pbrushPen->iBrushStyle = ulBrushStyle;
// FIXME: Copy the bitmap first ?
pbrushPen->hbmClient = (HANDLE)ulClientHatch;
pbrushPen->dwStyleCount = dwStyleCount;
@@ -256,7 +256,7 @@
pExtLogPen = (PEXTLOGPEN)pBuffer;
pExtLogPen->elpPenStyle = pbrushPen->ulPenStyle;
pExtLogPen->elpWidth = 0;
- pExtLogPen->elpBrushStyle = pbrushPen->ulStyle;
+ pExtLogPen->elpBrushStyle = pbrushPen->iBrushStyle;
pExtLogPen->elpColor = pbrushPen->BrushAttr.lbColor;
pExtLogPen->elpHatch = 0;
pExtLogPen->elpNumEntries = 0;
@@ -265,7 +265,8 @@
else
{
pLogPen = (PLOGPEN)pBuffer;
- pLogPen->lopnWidth = pbrushPen->ptPenWidth;
+ pLogPen->lopnWidth.x = pbrushPen->lWidth;
+ pLogPen->lopnWidth.y = 0;
pLogPen->lopnStyle = pbrushPen->ulPenStyle;
pLogPen->lopnColor = pbrushPen->BrushAttr.lbColor;
}
@@ -282,8 +283,8 @@
if (cbCount < cbRetCount) return 0;
pExtLogPen = (PEXTLOGPEN)pBuffer;
pExtLogPen->elpPenStyle = pbrushPen->ulPenStyle;
- pExtLogPen->elpWidth = pbrushPen->ptPenWidth.x;
- pExtLogPen->elpBrushStyle = pbrushPen->ulStyle;
+ pExtLogPen->elpWidth = pbrushPen->lWidth;
+ pExtLogPen->elpBrushStyle = pbrushPen->iBrushStyle;
pExtLogPen->elpColor = pbrushPen->BrushAttr.lbColor;
pExtLogPen->elpHatch = (ULONG_PTR)pbrushPen->hbmClient;
pExtLogPen->elpNumEntries = pbrushPen->dwStyleCount;
Modified: trunk/reactos/win32ss/gdi/ntgdi/stockobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/stockobj…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/stockobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/stockobj.c [iso-8859-1] Wed Feb 11 21:33:50 2015
@@ -114,11 +114,12 @@
if ((dwPenStyle & PS_STYLE_MASK) == PS_NULL) dwWidth = 1;
- pbrushPen->ptPenWidth.x = abs(dwWidth);
- pbrushPen->ptPenWidth.y = 0;
+ pbrushPen->iHatch = 0;
+ pbrushPen->lWidth = abs(dwWidth);
+ pbrushPen->eWidth = (FLOAT)pbrushPen->lWidth;
pbrushPen->ulPenStyle = dwPenStyle;
pbrushPen->BrushAttr.lbColor = ulColor;
- pbrushPen->ulStyle = ulBrushStyle;
+ pbrushPen->iBrushStyle = ulBrushStyle;
pbrushPen->hbmClient = (HANDLE)NULL;
pbrushPen->dwStyleCount = 0;
pbrushPen->pStyle = 0;