mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:26:00 +00:00
[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!) svn path=/trunk/; revision=66227
This commit is contained in:
parent
1b7dcc47ca
commit
3035893507
8 changed files with 71 additions and 51 deletions
|
@ -312,8 +312,8 @@ EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver)
|
|||
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
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ IntArc( DC *dc,
|
|||
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 @@ IntArc( DC *dc,
|
|||
}
|
||||
|
||||
if (!PenWidth) PenWidth = 1;
|
||||
pbrPen->ptPenWidth.x = PenWidth;
|
||||
pbrPen->lWidth = PenWidth;
|
||||
|
||||
RectBounds.left = Left;
|
||||
RectBounds.right = Right;
|
||||
|
@ -181,7 +181,7 @@ IntArc( DC *dc,
|
|||
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;
|
||||
|
|
|
@ -181,7 +181,7 @@ BRUSH_GetObject(PBRUSH pbrush, INT cjSize, LPLOGBRUSH plogbrush)
|
|||
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 @@ IntGdiCreateHatchBrush(
|
|||
|
||||
pbrush->flAttrs |= BR_IS_HATCH;
|
||||
pbrush->BrushAttr.lbColor = Color & 0xFFFFFF;
|
||||
pbrush->ulStyle = Style;
|
||||
pbrush->iHatch = Style;
|
||||
|
||||
GDIOBJ_vUnlockObject(&pbrush->BaseObject);
|
||||
|
||||
|
|
|
@ -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 @@ typedef struct _EBRUSHOBJ
|
|||
#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];
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
|
|||
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 app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen
|
|||
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 @@ IntDrawRoundRect( PDC dc,
|
|||
{
|
||||
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;
|
||||
|
|
|
@ -252,7 +252,7 @@ NtGdiEllipse(
|
|||
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 @@ NtGdiEllipse(
|
|||
}
|
||||
|
||||
if (!PenWidth) PenWidth = 1;
|
||||
pbrush->ptPenWidth.x = PenWidth;
|
||||
pbrush->lWidth = PenWidth;
|
||||
|
||||
RectBounds.left = Left;
|
||||
RectBounds.right = Right;
|
||||
|
@ -330,7 +330,7 @@ NtGdiEllipse(
|
|||
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 @@ IntRoundRect(
|
|||
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 @@ IntRoundRect(
|
|||
}
|
||||
|
||||
if (!PenWidth) PenWidth = 1;
|
||||
pbrLine->ptPenWidth.x = PenWidth;
|
||||
pbrLine->lWidth = PenWidth;
|
||||
|
||||
RectBounds.left = Left;
|
||||
RectBounds.top = Top;
|
||||
|
@ -829,7 +829,7 @@ IntRoundRect(
|
|||
}
|
||||
|
||||
|
||||
pbrLine->ptPenWidth.x = PenOrigWidth;
|
||||
pbrLine->lWidth = PenOrigWidth;
|
||||
PEN_ShareUnlockPen(pbrLine);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -120,11 +120,11 @@ IntGdiExtCreatePen(
|
|||
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 @@ PEN_GetObject(PBRUSH pbrushPen, INT cbCount, PLOGPEN pBuffer)
|
|||
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 @@ PEN_GetObject(PBRUSH pbrushPen, INT cbCount, PLOGPEN pBuffer)
|
|||
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 @@ PEN_GetObject(PBRUSH pbrushPen, INT cbCount, PLOGPEN pBuffer)
|
|||
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;
|
||||
|
|
|
@ -114,11 +114,12 @@ IntCreateStockPen(DWORD dwPenStyle,
|
|||
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue