Start to cleanup the mess that claims to be our brush implementation: Rename GDIBRUSHOBJ to BRUSH and GDIBRUSHINST to EBRUSHOBJ. Because that's what it is and nothing else. Rename several BRUSHOBJ_xxx functions to BRUSH_xxx, as they deal with a BRUSH, not a BRUSHOBJ.

There is a strict difference between a BRUSH and an (E)BRUSHOBJ. Please don't mix this up by giving them all names like BrushObj. Please use (proper!) hungarian notation.

Now the willing reader might actually get a clue how this stuff is supposed to work and maybe also realize how broken it is.

svn path=/trunk/; revision=40143
This commit is contained in:
Timo Kreuzer 2009-03-20 22:40:14 +00:00
parent d9e83ed22d
commit 87e87cd3bf
18 changed files with 559 additions and 560 deletions

View file

@ -39,7 +39,7 @@ typedef BOOLEAN (APIENTRY *PBLTRECTFUNC)(SURFOBJ* OutputObj,
RECTL* OutputRect,
POINTL* InputPoint,
POINTL* MaskOrigin,
BRUSHOBJ* Brush,
BRUSHOBJ* pbo,
POINTL* BrushOrigin,
ROP4 Rop4);
typedef BOOLEAN (APIENTRY *PSTRETCHRECTFUNC)(SURFOBJ* OutputObj,
@ -49,7 +49,7 @@ typedef BOOLEAN (APIENTRY *PSTRETCHRECTFUNC)(SURFOBJ* OutputObj,
RECTL* OutputRect,
RECTL* InputRect,
POINTL* MaskOrigin,
BRUSHOBJ* BrushObj,
BRUSHOBJ* pbo,
POINTL* BrushOrigin,
ROP4 Rop4);
@ -84,7 +84,7 @@ BltMask(SURFOBJ* Dest,
RECTL* DestRect,
POINTL* SourcePoint,
POINTL* MaskPoint,
BRUSHOBJ* Brush,
BRUSHOBJ* pbo,
POINTL* BrushPoint,
ROP4 Rop4)
{
@ -92,7 +92,7 @@ BltMask(SURFOBJ* Dest,
BYTE *tMask, *lMask;
static BYTE maskbit[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
/* Pattern brushes */
PGDIBRUSHINST GdiBrush = NULL;
PEBRUSHOBJ GdiBrush = NULL;
SURFOBJ *psoPattern = NULL;
PSURFACE psurfPattern;
ULONG PatternWidth = 0, PatternHeight = 0, PatternY = 0;
@ -105,11 +105,11 @@ BltMask(SURFOBJ* Dest,
dx = DestRect->right - DestRect->left;
dy = DestRect->bottom - DestRect->top;
if (Brush && Brush->iSolidColor == 0xFFFFFFFF)
if (pbo && pbo->iSolidColor == 0xFFFFFFFF)
{
GdiBrush = CONTAINING_RECORD(
Brush,
GDIBRUSHINST,
pbo,
EBRUSHOBJ,
BrushObject);
psurfPattern = SURFACE_LockSurface(GdiBrush->GdiBrushObject->hbmPattern);
@ -139,7 +139,7 @@ BltMask(SURFOBJ* Dest,
if (psurfPattern == NULL)
{
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_PutPixel(
Dest, DestRect->left + i, DestRect->top + j, Brush ? Brush->iSolidColor : 0);
Dest, DestRect->left + i, DestRect->top + j, pbo ? pbo->iSolidColor : 0);
}
else
{
@ -172,14 +172,14 @@ BltPatCopy(SURFOBJ* Dest,
RECTL* DestRect,
POINTL* SourcePoint,
POINTL* MaskPoint,
BRUSHOBJ* Brush,
BRUSHOBJ* pbo,
POINTL* BrushPoint,
ROP4 Rop4)
{
// These functions are assigned if we're working with a DIB
// The assigned functions depend on the bitsPerPixel of the DIB
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_ColorFill(Dest, DestRect, Brush ? Brush->iSolidColor : 0);
DibFunctionsForBitmapFormat[Dest->iBitmapFormat].DIB_ColorFill(Dest, DestRect, pbo ? pbo->iSolidColor : 0);
return TRUE;
}
@ -192,12 +192,12 @@ CallDibBitBlt(SURFOBJ* OutputObj,
RECTL* OutputRect,
POINTL* InputPoint,
POINTL* MaskOrigin,
BRUSHOBJ* Brush,
BRUSHOBJ* pbo,
POINTL* BrushOrigin,
ROP4 Rop4)
{
BLTINFO BltInfo;
PGDIBRUSHINST GdiBrush = NULL;
PEBRUSHOBJ GdiBrush = NULL;
SURFACE *psurfPattern;
BOOLEAN Result;
@ -212,14 +212,14 @@ CallDibBitBlt(SURFOBJ* OutputObj,
return DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
BltInfo.XlatePatternToDest = NULL;
BltInfo.Brush = Brush;
BltInfo.Brush = pbo;
BltInfo.BrushOrigin = *BrushOrigin;
BltInfo.Rop4 = Rop4;
/* Pattern brush */
if (ROP4_USES_PATTERN(Rop4) && Brush && Brush->iSolidColor == 0xFFFFFFFF)
if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF)
{
GdiBrush = CONTAINING_RECORD(Brush, GDIBRUSHINST, BrushObject);
GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
if ((psurfPattern = SURFACE_LockSurface(GdiBrush->GdiBrushObject->hbmPattern)))
{
BltInfo.PatternSurface = &psurfPattern->SurfObj;
@ -307,7 +307,7 @@ EngBitBlt(SURFOBJ *DestObj,
RECTL *DestRect,
POINTL *SourcePoint,
POINTL *MaskOrigin,
BRUSHOBJ *Brush,
BRUSHOBJ *pbo,
POINTL *BrushOrigin,
ROP4 Rop4)
{
@ -487,7 +487,7 @@ EngBitBlt(SURFOBJ *DestObj,
}
else if (ROP3_TO_ROP4(PATCOPY) == Rop4)
{
if (Brush && Brush->iSolidColor == 0xFFFFFFFF)
if (pbo && pbo->iSolidColor == 0xFFFFFFFF)
BltRectFunc = CallDibBitBlt;
else
BltRectFunc = BltPatCopy;
@ -502,7 +502,7 @@ EngBitBlt(SURFOBJ *DestObj,
{
case DC_TRIVIAL:
Ret = (*BltRectFunc)(OutputObj, InputObj, Mask, ColorTranslation,
&OutputRect, &InputPoint, MaskOrigin, Brush,
&OutputRect, &InputPoint, MaskOrigin, pbo,
&AdjustedBrushOrigin, Rop4);
break;
case DC_RECT:
@ -516,7 +516,7 @@ EngBitBlt(SURFOBJ *DestObj,
Pt.x = InputPoint.x + CombinedRect.left - OutputRect.left;
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
Ret = (*BltRectFunc)(OutputObj, InputObj, Mask, ColorTranslation,
&CombinedRect, &Pt, MaskOrigin, Brush,
&CombinedRect, &Pt, MaskOrigin, pbo,
&AdjustedBrushOrigin, Rop4);
}
break;
@ -557,7 +557,7 @@ EngBitBlt(SURFOBJ *DestObj,
Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top;
Ret = (*BltRectFunc)(OutputObj, InputObj, Mask,
ColorTranslation, &CombinedRect, &Pt,
MaskOrigin, Brush, &AdjustedBrushOrigin,
MaskOrigin, pbo, &AdjustedBrushOrigin,
Rop4) && Ret;
}
}
@ -585,7 +585,7 @@ IntEngBitBltEx(SURFOBJ *psoDest,
RECTL *DestRect,
POINTL *SourcePoint,
POINTL *MaskOrigin,
BRUSHOBJ *Brush,
BRUSHOBJ *pbo,
POINTL *BrushOrigin,
ROP4 Rop4,
BOOL RemoveMouse)
@ -703,14 +703,14 @@ IntEngBitBltEx(SURFOBJ *psoDest,
{
ret = GDIDEVFUNCS(psoDest).BitBlt(
psoDest, psoSource, MaskSurf, ClipRegion, ColorTranslation,
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin,
&OutputRect, &InputPoint, MaskOrigin, pbo, BrushOrigin,
Rop4);
}
if (! ret)
{
ret = EngBitBlt(psoDest, psoSource, MaskSurf, ClipRegion, ColorTranslation,
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin,
&OutputRect, &InputPoint, MaskOrigin, pbo, BrushOrigin,
Rop4);
}
@ -740,13 +740,13 @@ CallDibStretchBlt(SURFOBJ* psoDest,
RECTL* OutputRect,
RECTL* InputRect,
POINTL* MaskOrigin,
BRUSHOBJ* Brush,
BRUSHOBJ* pbo,
POINTL* BrushOrigin,
ROP4 Rop4)
{
POINTL RealBrushOrigin;
SURFACE* psurfPattern;
PGDIBRUSHINST GdiBrush = NULL;
PEBRUSHOBJ GdiBrush = NULL;
SURFOBJ* PatternSurface = NULL;
XLATEOBJ* XlatePatternToDest = NULL;
@ -760,9 +760,9 @@ CallDibStretchBlt(SURFOBJ* psoDest,
}
/* Pattern brush */
if (ROP4_USES_PATTERN(Rop4) && Brush && Brush->iSolidColor == 0xFFFFFFFF)
if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF)
{
GdiBrush = CONTAINING_RECORD(Brush, GDIBRUSHINST, BrushObject);
GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
psurfPattern = SURFACE_LockSurface(GdiBrush->GdiBrushObject->hbmPattern);
if (psurfPattern)
{
@ -781,7 +781,7 @@ CallDibStretchBlt(SURFOBJ* psoDest,
return DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_StretchBlt(
psoDest, psoSource, PatternSurface,
OutputRect, InputRect, MaskOrigin, Brush, &RealBrushOrigin,
OutputRect, InputRect, MaskOrigin, pbo, &RealBrushOrigin,
ColorTranslation, XlatePatternToDest, Rop4);
/* Pattern brush */
@ -857,7 +857,7 @@ EngStretchBltROP(
IN RECTL *prclSrc,
IN POINTL *MaskOrigin,
IN ULONG Mode,
IN BRUSHOBJ *Brush,
IN BRUSHOBJ *pbo,
IN DWORD ROP4)
{
RECTL InputRect;
@ -1018,7 +1018,7 @@ EngStretchBltROP(
case DC_TRIVIAL:
Ret = (*BltRectFunc)(psoOutput, psoInput, Mask,
ColorTranslation, &OutputRect, &InputRect, MaskOrigin,
Brush, &AdjustedBrushOrigin, ROP4);
pbo, &AdjustedBrushOrigin, ROP4);
break;
case DC_RECT:
// Clip the blt to the clip rectangle
@ -1037,7 +1037,7 @@ EngStretchBltROP(
&CombinedRect,
&InputToCombinedRect,
MaskOrigin,
Brush,
pbo,
&AdjustedBrushOrigin,
ROP4);
}
@ -1082,7 +1082,7 @@ EngStretchBltROP(
&CombinedRect,
&InputToCombinedRect,
MaskOrigin,
Brush,
pbo,
&AdjustedBrushOrigin,
ROP4);
}
@ -1144,7 +1144,7 @@ IntEngStretchBlt(SURFOBJ *psoDest,
RECTL *DestRect,
RECTL *SourceRect,
POINTL *pMaskOrigin,
BRUSHOBJ *Brush,
BRUSHOBJ *pbo,
POINTL *BrushOrigin,
ROP4 ROP)
{
@ -1245,14 +1245,14 @@ IntEngStretchBlt(SURFOBJ *psoDest,
/* Drv->StretchBltROP (look at http://www.osronline.com/ddkx/graphics/ddifncs_0z3b.htm ) */
// FIXME: MaskOrigin is always NULL !
ret = GDIDEVFUNCS(psoDest).StretchBltROP(psoDest, (UsesSource) ? psoSource : NULL, MaskSurf, ClipRegion, ColorTranslation,
&ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, Brush, ROP);
&ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, pbo, ROP);
}
if (! ret)
{
// FIXME: see previous fixme
ret = EngStretchBltROP(psoDest, (UsesSource) ? psoSource : NULL, MaskSurf, ClipRegion, ColorTranslation,
&ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, Brush, ROP);
&ca, BrushOrigin, &OutputRect, &InputRect, NULL, COLORONCOLOR, pbo, ROP);
}
if (UsesSource)
@ -1644,7 +1644,7 @@ AlphaBltMask(SURFOBJ* psoDest,
RECTL* DestRect,
POINTL* SourcePoint,
POINTL* MaskPoint,
BRUSHOBJ* Brush,
BRUSHOBJ* pbo,
POINTL* BrushPoint)
{
LONG i, j, dx, dy;
@ -1657,7 +1657,7 @@ AlphaBltMask(SURFOBJ* psoDest,
if (Mask != NULL)
{
BrushColor = XLATEOBJ_iXlate(SrcColorTranslation, Brush ? Brush->iSolidColor : 0);
BrushColor = XLATEOBJ_iXlate(SrcColorTranslation, pbo ? pbo->iSolidColor : 0);
r = (int)GetRValue(BrushColor);
g = (int)GetGValue(BrushColor);
b = (int)GetBValue(BrushColor);
@ -1673,7 +1673,7 @@ AlphaBltMask(SURFOBJ* psoDest,
if (*lMask == 0xff)
{
DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel(
psoDest, DestRect->left + i, DestRect->top + j, Brush ? Brush->iSolidColor : 0);
psoDest, DestRect->left + i, DestRect->top + j, pbo ? pbo->iSolidColor : 0);
}
else
{
@ -1711,7 +1711,7 @@ EngMaskBitBlt(SURFOBJ *psoDest,
RECTL *DestRect,
POINTL *SourcePoint,
POINTL *MaskOrigin,
BRUSHOBJ *Brush,
BRUSHOBJ *pbo,
POINTL *BrushOrigin)
{
BYTE clippingType;
@ -1833,10 +1833,10 @@ EngMaskBitBlt(SURFOBJ *psoDest,
case DC_TRIVIAL:
if (psoMask->iBitmapFormat == BMF_8BPP)
Ret = AlphaBltMask(psoOutput, psoInput, psoMask, DestColorTranslation, SourceColorTranslation,
&OutputRect, &InputPoint, MaskOrigin, Brush, &AdjustedBrushOrigin);
&OutputRect, &InputPoint, MaskOrigin, pbo, &AdjustedBrushOrigin);
else
Ret = BltMask(psoOutput, psoInput, psoMask, DestColorTranslation,
&OutputRect, &InputPoint, MaskOrigin, Brush, &AdjustedBrushOrigin,
&OutputRect, &InputPoint, MaskOrigin, pbo, &AdjustedBrushOrigin,
R4_MASK);
break;
case DC_RECT:
@ -1852,12 +1852,12 @@ EngMaskBitBlt(SURFOBJ *psoDest,
if (psoMask->iBitmapFormat == BMF_8BPP)
{
Ret = AlphaBltMask(psoOutput, psoInput, psoMask, DestColorTranslation, SourceColorTranslation,
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin);
&CombinedRect, &Pt, MaskOrigin, pbo, &AdjustedBrushOrigin);
}
else
{
Ret = BltMask(psoOutput, psoInput, psoMask, DestColorTranslation,
&CombinedRect, &Pt, MaskOrigin, Brush, &AdjustedBrushOrigin, R4_MASK);
&CombinedRect, &Pt, MaskOrigin, pbo, &AdjustedBrushOrigin, R4_MASK);
}
}
break;
@ -1898,14 +1898,14 @@ EngMaskBitBlt(SURFOBJ *psoDest,
Ret = AlphaBltMask(psoOutput, psoInput, psoMask,
DestColorTranslation,
SourceColorTranslation,
&CombinedRect, &Pt, MaskOrigin, Brush,
&CombinedRect, &Pt, MaskOrigin, pbo,
&AdjustedBrushOrigin) && Ret;
}
else
{
Ret = BltMask(psoOutput, psoInput, psoMask,
DestColorTranslation, &CombinedRect, &Pt,
MaskOrigin, Brush, &AdjustedBrushOrigin,
MaskOrigin, pbo, &AdjustedBrushOrigin,
R4_MASK) && Ret;
}
}
@ -1931,7 +1931,7 @@ IntEngMaskBlt(SURFOBJ *psoDest,
RECTL *DestRect,
POINTL *SourcePoint,
POINTL *MaskOrigin,
BRUSHOBJ *Brush,
BRUSHOBJ *pbo,
POINTL *BrushOrigin)
{
BOOLEAN ret;
@ -1975,15 +1975,15 @@ IntEngMaskBlt(SURFOBJ *psoDest,
This should really be done using a call to DrvSynchronizeSurface,
but the VMware driver doesn't hook that call. */
IntEngBitBltEx(psoDest, NULL, psoMask, ClipRegion, DestColorTranslation,
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin,
DestRect, SourcePoint, MaskOrigin, pbo, BrushOrigin,
R4_NOOP, FALSE);
ret = EngMaskBitBlt(psoDest, psoMask, ClipRegion, DestColorTranslation, SourceColorTranslation,
&OutputRect, &InputPoint, MaskOrigin, Brush, BrushOrigin);
&OutputRect, &InputPoint, MaskOrigin, pbo, BrushOrigin);
/* Dummy BitBlt to let driver know that something has changed. */
IntEngBitBltEx(psoDest, NULL, psoMask, ClipRegion, DestColorTranslation,
DestRect, SourcePoint, MaskOrigin, Brush, BrushOrigin,
DestRect, SourcePoint, MaskOrigin, pbo, BrushOrigin,
R4_NOOP, FALSE);
MouseSafetyOnDrawEnd(psoDest);

View file

@ -46,7 +46,7 @@ TranslateRects(RECT_ENUM *RectEnum, POINTL* Translate)
*/
void FASTCALL
NWtoSE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay,
BRUSHOBJ* pbo, LONG x, LONG y, LONG deltax, LONG deltay,
POINTL* Translate)
{
int i;
@ -54,7 +54,7 @@ NWtoSE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BOOLEAN EnumMore;
RECTL* ClipRect;
RECT_ENUM RectEnum;
ULONG Pixel = Brush->iSolidColor;
ULONG Pixel = pbo->iSolidColor;
LONG delta;
CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTDOWN, 0);
@ -117,7 +117,7 @@ NWtoSE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
void FASTCALL
SWtoNE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay,
BRUSHOBJ* pbo, LONG x, LONG y, LONG deltax, LONG deltay,
POINTL* Translate)
{
int i;
@ -125,7 +125,7 @@ SWtoNE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BOOLEAN EnumMore;
RECTL* ClipRect;
RECT_ENUM RectEnum;
ULONG Pixel = Brush->iSolidColor;
ULONG Pixel = pbo->iSolidColor;
LONG delta;
CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_RIGHTUP, 0);
@ -187,7 +187,7 @@ SWtoNE(SURFOBJ* OutputObj, CLIPOBJ* Clip,
void FASTCALL
NEtoSW(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay,
BRUSHOBJ* pbo, LONG x, LONG y, LONG deltax, LONG deltay,
POINTL* Translate)
{
int i;
@ -195,7 +195,7 @@ NEtoSW(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BOOLEAN EnumMore;
RECTL* ClipRect;
RECT_ENUM RectEnum;
ULONG Pixel = Brush->iSolidColor;
ULONG Pixel = pbo->iSolidColor;
LONG delta;
CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_LEFTDOWN, 0);
@ -257,7 +257,7 @@ NEtoSW(SURFOBJ* OutputObj, CLIPOBJ* Clip,
void FASTCALL
SEtoNW(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay,
BRUSHOBJ* pbo, LONG x, LONG y, LONG deltax, LONG deltay,
POINTL* Translate)
{
int i;
@ -265,7 +265,7 @@ SEtoNW(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BOOLEAN EnumMore;
RECTL* ClipRect;
RECT_ENUM RectEnum;
ULONG Pixel = Brush->iSolidColor;
ULONG Pixel = pbo->iSolidColor;
LONG delta;
CLIPOBJ_cEnumStart(Clip, FALSE, CT_RECTANGLES, CD_LEFTUP, 0);
@ -331,7 +331,7 @@ SEtoNW(SURFOBJ* OutputObj, CLIPOBJ* Clip,
BOOL APIENTRY
EngLineTo(SURFOBJ *DestObj,
CLIPOBJ *Clip,
BRUSHOBJ *Brush,
BRUSHOBJ *pbo,
LONG x1,
LONG y1,
LONG x2,
@ -341,7 +341,7 @@ EngLineTo(SURFOBJ *DestObj,
{
LONG x, y, deltax, deltay, xchange, ychange, hx, vy;
ULONG i;
ULONG Pixel = Brush->iSolidColor;
ULONG Pixel = pbo->iSolidColor;
SURFOBJ *OutputObj;
RECTL DestRect;
POINTL Translate;
@ -477,22 +477,22 @@ EngLineTo(SURFOBJ *DestObj,
{
if (0 < ychange)
{
NWtoSE(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate);
NWtoSE(OutputObj, Clip, pbo, x, y, deltax, deltay, &Translate);
}
else
{
SWtoNE(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate);
SWtoNE(OutputObj, Clip, pbo, x, y, deltax, deltay, &Translate);
}
}
else
{
if (0 < ychange)
{
NEtoSW(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate);
NEtoSW(OutputObj, Clip, pbo, x, y, deltax, deltay, &Translate);
}
else
{
SEtoNW(OutputObj, Clip, Brush, x, y, deltax, deltay, &Translate);
SEtoNW(OutputObj, Clip, pbo, x, y, deltax, deltay, &Translate);
}
}
}
@ -508,7 +508,7 @@ EngLineTo(SURFOBJ *DestObj,
BOOL APIENTRY
IntEngLineTo(SURFOBJ *psoDest,
CLIPOBJ *ClipObj,
BRUSHOBJ *Brush,
BRUSHOBJ *pbo,
LONG x1,
LONG y1,
LONG x2,
@ -518,7 +518,7 @@ IntEngLineTo(SURFOBJ *psoDest,
{
BOOLEAN ret;
SURFACE *psurfDest;
PGDIBRUSHINST GdiBrush;
PEBRUSHOBJ GdiBrush;
RECTL b;
ASSERT(psoDest);
@ -526,8 +526,8 @@ IntEngLineTo(SURFOBJ *psoDest,
ASSERT(psurfDest);
GdiBrush = CONTAINING_RECORD(
Brush,
GDIBRUSHINST,
pbo,
EBRUSHOBJ,
BrushObject);
ASSERT(GdiBrush);
ASSERT(GdiBrush->GdiBrushObject);
@ -572,7 +572,7 @@ IntEngLineTo(SURFOBJ *psoDest,
{
/* Call the driver's DrvLineTo */
ret = GDIDEVFUNCS(psoDest).LineTo(
psoDest, ClipObj, Brush, x1, y1, x2, y2, &b, Mix);
psoDest, ClipObj, pbo, x1, y1, x2, y2, &b, Mix);
}
#if 0
@ -584,7 +584,7 @@ IntEngLineTo(SURFOBJ *psoDest,
if (! ret)
{
ret = EngLineTo(psoDest, ClipObj, Brush, x1, y1, x2, y2, RectBounds, Mix);
ret = EngLineTo(psoDest, ClipObj, pbo, x1, y1, x2, y2, RectBounds, Mix);
}
MouseSafetyOnDrawEnd(psoDest);
@ -596,7 +596,7 @@ IntEngLineTo(SURFOBJ *psoDest,
BOOL APIENTRY
IntEngPolyline(SURFOBJ *psoDest,
CLIPOBJ *Clip,
BRUSHOBJ *Brush,
BRUSHOBJ *pbo,
CONST LPPOINT pt,
LONG dCount,
MIX Mix)
@ -614,7 +614,7 @@ IntEngPolyline(SURFOBJ *psoDest,
rect.bottom = max(pt[i-1].y, pt[i].y);
ret = IntEngLineTo(psoDest,
Clip,
Brush,
pbo,
pt[i-1].x,
pt[i-1].y,
pt[i].x,

View file

@ -42,14 +42,14 @@ typedef struct
DWORD *pStyle;
ULONG dwStyleCount;
ULONG Unknown6C;
} GDIBRUSHOBJ, *PGDIBRUSHOBJ;
} BRUSH, *PBRUSH;
typedef struct
{
BRUSHOBJ BrushObject;
PGDIBRUSHOBJ GdiBrushObject;
PBRUSH GdiBrushObject;
XLATEOBJ *XlateObject;
} GDIBRUSHINST, *PGDIBRUSHINST;
} EBRUSHOBJ, *PEBRUSHOBJ;
/* GDI Brush Attributes */
#define GDIBRUSH_NEED_FG_CLR 0x0001
@ -71,14 +71,14 @@ typedef struct
#define GDIBRUSH_CACHED_ENGINE 0x00040000
#define GDIBRUSH_CACHED_IS_SOLID 0x80000000
#define BRUSHOBJ_AllocBrush() ((PGDIBRUSHOBJ) GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE))
#define BRUSHOBJ_AllocBrushWithHandle() ((PGDIBRUSHOBJ) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_BRUSH))
#define BRUSHOBJ_FreeBrush(pBrush) GDIOBJ_FreeObj((POBJ)pBrush, GDIObjType_BRUSH_TYPE)
#define BRUSHOBJ_FreeBrushByHandle(hBrush) GDIOBJ_FreeObjByHandle((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)
#define BRUSHOBJ_LockBrush(hBrush) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
#define BRUSHOBJ_UnlockBrush(pBrush) GDIOBJ_UnlockObjByPtr((POBJ)pBrush)
#define BRUSH_AllocBrush() ((PBRUSH) GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE))
#define BRUSH_AllocBrushWithHandle() ((PBRUSH) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_BRUSH))
#define BRUSH_FreeBrush(pBrush) GDIOBJ_FreeObj((POBJ)pBrush, GDIObjType_BRUSH_TYPE)
#define BRUSH_FreeBrushByHandle(hBrush) GDIOBJ_FreeObjByHandle((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)
#define BRUSH_LockBrush(hBrush) ((PBRUSH)GDIOBJ_LockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH))
#define BRUSH_UnlockBrush(pBrush) GDIOBJ_UnlockObjByPtr((POBJ)pBrush)
INT FASTCALL BRUSH_GetObject (PGDIBRUSHOBJ GdiObject, INT Count, LPLOGBRUSH Buffer);
INT FASTCALL BRUSH_GetObject (PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer);
BOOL INTERNAL_CALL BRUSH_Cleanup(PVOID ObjectBody);
#endif

View file

@ -130,8 +130,8 @@ typedef struct _DCLEVEL
DWORD unk1_00000000;
HGDIOBJ hdcSave;
POINTL ptlBrushOrigin;
PGDIBRUSHOBJ pbrFill;
PGDIBRUSHOBJ pbrLine;
PBRUSH pbrFill;
PBRUSH pbrLine;
PVOID plfnt; /* LFONTOBJ* (TEXTOBJ*) */
HGDIOBJ hPath; /* HPATH */
FLONG flPath;

View file

@ -9,14 +9,14 @@ extern HDC hSystemBM;
extern HSEMAPHORE hsemDriverMgmt;
XLATEOBJ* FASTCALL
IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed);
IntGdiCreateBrushXlate(PDC Dc, BRUSH *BrushObj, BOOLEAN *Failed);
XLATEOBJ*
FASTCALL
IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, SURFACE* pDestSurf, SURFACE* pSrcSurf);
VOID FASTCALL
IntGdiInitBrushInstance(GDIBRUSHINST *BrushInst, PGDIBRUSHOBJ BrushObj, XLATEOBJ *XlateObj);
IntGdiInitBrushInstance(EBRUSHOBJ *BrushInst, PBRUSH BrushObj, XLATEOBJ *XlateObj);
HBRUSH APIENTRY
IntGdiCreateDIBBrush(
@ -49,7 +49,7 @@ IntPatBlt(
INT Width,
INT Height,
DWORD ROP,
PGDIBRUSHOBJ BrushObj);
PBRUSH BrushObj);
VOID FASTCALL
IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color);

View file

@ -7,25 +7,25 @@
/* Internal interface */
#define PENOBJ_AllocPen() ((HPEN)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE))
#define PENOBJ_AllocPenWithHandle() ((PGDIBRUSHOBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PEN))
#define PENOBJ_AllocPenWithHandle() ((PBRUSH)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PEN))
#define PENOBJ_FreePen(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_BRUSH_TYPE)
#define PENOBJ_FreePenByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN)
//#define PENOBJ_LockPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN))
//#define PENOBJ_LockPen(hBMObj) ((PBRUSH)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN))
#define PENOBJ_AllocExtPen() ((PGDIBRUSHOBJ)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE))
#define PENOBJ_AllocExtPenWithHandle() ((PGDIBRUSHOBJ)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_EXTPEN))
#define PENOBJ_AllocExtPen() ((PBRUSH)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE))
#define PENOBJ_AllocExtPenWithHandle() ((PBRUSH)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_EXTPEN))
#define PENOBJ_FreeExtPen(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_BRUSH_TYPE)
#define PENOBJ_FreeExtPenByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN)
//#define PENOBJ_LockExtPen(hBMObj) ((PGDIBRUSHOBJ)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN))
//#define PENOBJ_LockExtPen(hBMObj) ((PBRUSH)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN))
#define PENOBJ_UnlockPen(pPenObj) GDIOBJ_UnlockObjByPtr((POBJ)pPenObj)
PGDIBRUSHOBJ FASTCALL PENOBJ_LockPen(HGDIOBJ);
INT APIENTRY PEN_GetObject(PGDIBRUSHOBJ hPen, INT Count, PLOGPEN Buffer);
PBRUSH FASTCALL PENOBJ_LockPen(HGDIOBJ);
INT APIENTRY PEN_GetObject(PBRUSH pPen, INT Count, PLOGPEN Buffer);
#endif

View file

@ -26,7 +26,7 @@
#define Rcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0)))
BOOL FASTCALL IntFillArc( PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, double StartArc, double EndArc, ARCTYPE arctype);
BOOL FASTCALL IntDrawArc( PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, double StartArc, double EndArc, ARCTYPE arctype, PGDIBRUSHOBJ PenBrushObj);
BOOL FASTCALL IntDrawArc( PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, double StartArc, double EndArc, ARCTYPE arctype, PBRUSH pbrush);
static
BOOL
@ -44,8 +44,8 @@ IntArc( DC *dc,
{
PDC_ATTR pdcattr;
RECTL RectBounds, RectSEpts;
PGDIBRUSHOBJ PenBrushObj;
GDIBRUSHINST PenBrushInst;
PBRUSH pbrushPen;
EBRUSHOBJ eboPen;
SURFACE *psurf;
BOOL ret = TRUE;
LONG PenWidth, PenOrigWidth;
@ -70,18 +70,18 @@ IntArc( DC *dc,
pdcattr = dc->pdcattr;
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
if (NULL == PenBrushObj)
pbrushPen = PENOBJ_LockPen(pdcattr->hpen);
if (!pbrushPen)
{
DPRINT1("Arc Fail 1\n");
SetLastWin32Error(ERROR_INTERNAL_ERROR);
return FALSE;
}
PenOrigWidth = PenWidth = PenBrushObj->ptPenWidth.x;
if (PenBrushObj->ulPenStyle == PS_NULL) PenWidth = 0;
PenOrigWidth = PenWidth = pbrushPen->ptPenWidth.x;
if (pbrushPen->ulPenStyle == PS_NULL) PenWidth = 0;
if (PenBrushObj->ulPenStyle == PS_INSIDEFRAME)
if (pbrushPen->ulPenStyle == PS_INSIDEFRAME)
{
if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2;
if (2*PenWidth > (Bottom - Top)) PenWidth = (Bottom -Top + 1)/2;
@ -92,7 +92,7 @@ IntArc( DC *dc,
}
if (!PenWidth) PenWidth = 1;
PenBrushObj->ptPenWidth.x = PenWidth;
pbrushPen->ptPenWidth.x = PenWidth;
RectBounds.left = Left;
RectBounds.right = Right;
@ -155,30 +155,30 @@ IntArc( DC *dc,
AngleStart,
AngleEnd,
arctype,
PenBrushObj);
pbrushPen);
psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
if (NULL == psurf)
{
DPRINT1("Arc Fail 2\n");
PENOBJ_UnlockPen(PenBrushObj);
PENOBJ_UnlockPen(pbrushPen);
SetLastWin32Error(ERROR_INTERNAL_ERROR);
return FALSE;
}
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->rosdc.XlatePen);
IntGdiInitBrushInstance(&eboPen, pbrushPen, dc->rosdc.XlatePen);
if (arctype == GdiTypePie)
{
PUTLINE(CenterX, CenterY, SfCx + CenterX, SfCy + CenterY, PenBrushInst);
PUTLINE(EfCx + CenterX, EfCy + CenterY, CenterX, CenterY, PenBrushInst);
PUTLINE(CenterX, CenterY, SfCx + CenterX, SfCy + CenterY, eboPen);
PUTLINE(EfCx + CenterX, EfCy + CenterY, CenterX, CenterY, eboPen);
}
if (arctype == GdiTypeChord)
PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY, PenBrushInst);
PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY, eboPen);
PenBrushObj->ptPenWidth.x = PenOrigWidth;
pbrushPen->ptPenWidth.x = PenOrigWidth;
SURFACE_UnlockSurface(psurf);
PENOBJ_UnlockPen(PenBrushObj);
PENOBJ_UnlockPen(pbrushPen);
DPRINT("IntArc Exit.\n");
return ret;
}

View file

@ -192,8 +192,8 @@ NtGdiBitBlt(
POINTL SourcePoint, BrushOrigin;
BOOL Status = FALSE;
XLATEOBJ *XlateObj = NULL;
PGDIBRUSHOBJ BrushObj = NULL;
GDIBRUSHINST BrushInst;
PBRUSH pbrush = NULL;
EBRUSHOBJ BrushInst;
BOOL UsesSource = ROP3_USES_SOURCE(ROP);
BOOL UsesPattern = ROP3_USES_PATTERN(ROP);
@ -285,14 +285,14 @@ NtGdiBitBlt(
if (UsesPattern)
{
BrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
if (NULL == BrushObj)
pbrush = BRUSH_LockBrush(pdcattr->hbrush);
if (NULL == pbrush)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
goto cleanup;
}
BrushOrigin = *((PPOINTL)&BrushObj->ptOrigin);
IntGdiInitBrushInstance(&BrushInst, BrushObj, DCDest->rosdc.XlateBrush);
BrushOrigin = *((PPOINTL)&pbrush->ptOrigin);
IntGdiInitBrushInstance(&BrushInst, pbrush, DCDest->rosdc.XlateBrush);
}
/* Create the XLATEOBJ. */
@ -313,7 +313,7 @@ NtGdiBitBlt(
Status = IntEngBitBlt(&BitmapDest->SurfObj, BitmapSrc ? &BitmapSrc->SurfObj : NULL, NULL,
DCDest->rosdc.CombinedClip, XlateObj, &DestRect,
&SourcePoint, NULL,
BrushObj ? &BrushInst.BrushObject : NULL,
pbrush ? &BrushInst.BrushObject : NULL,
&BrushOrigin, ROP3_TO_ROP4(ROP));
cleanup:
@ -328,9 +328,9 @@ cleanup:
{
SURFACE_UnlockSurface(BitmapSrc);
}
if (BrushObj != NULL)
if (pbrush != NULL)
{
BRUSHOBJ_UnlockBrush(BrushObj);
BRUSH_UnlockBrush(pbrush);
}
if (UsesSource && hDCSrc != hDCDest)
{
@ -756,8 +756,8 @@ NtGdiStretchBlt(
BOOL Status = FALSE;
XLATEOBJ *XlateObj = NULL;
POINTL BrushOrigin;
PGDIBRUSHOBJ BrushObj = NULL;
GDIBRUSHINST BrushInst;
PBRUSH pbrush = NULL;
EBRUSHOBJ BrushInst;
BOOL UsesSource = ROP3_USES_SOURCE(ROP);
BOOL UsesPattern = ROP3_USES_PATTERN(ROP);
@ -867,14 +867,14 @@ NtGdiStretchBlt(
if (UsesPattern)
{
BrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
if (NULL == BrushObj)
pbrush = BRUSH_LockBrush(pdcattr->hbrush);
if (NULL == pbrush)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
goto failed;
}
BrushOrigin = *((PPOINTL)&BrushObj->ptOrigin);
IntGdiInitBrushInstance(&BrushInst, BrushObj, DCDest->rosdc.XlateBrush);
BrushOrigin = *((PPOINTL)&pbrush->ptOrigin);
IntGdiInitBrushInstance(&BrushInst, pbrush, DCDest->rosdc.XlateBrush);
}
/* Offset the brush */
@ -885,7 +885,7 @@ NtGdiStretchBlt(
Status = IntEngStretchBlt(&BitmapDest->SurfObj, &BitmapSrc->SurfObj,
NULL, DCDest->rosdc.CombinedClip, XlateObj,
&DestRect, &SourceRect, NULL,
BrushObj ? &BrushInst.BrushObject : NULL,
pbrush ? &BrushInst.BrushObject : NULL,
&BrushOrigin, ROP3_TO_ROP4(ROP));
failed:
@ -893,9 +893,9 @@ failed:
{
EngDeleteXlate(XlateObj);
}
if (BrushObj)
if (pbrush)
{
BRUSHOBJ_UnlockBrush(BrushObj);
BRUSH_UnlockBrush(pbrush);
}
if (BitmapSrc && DCSrc->rosdc.hBitmap != DCDest->rosdc.hBitmap)
{
@ -922,11 +922,11 @@ IntPatBlt(
INT Width,
INT Height,
DWORD ROP,
PGDIBRUSHOBJ BrushObj)
PBRUSH BrushObj)
{
RECTL DestRect;
SURFACE *psurf;
GDIBRUSHINST BrushInst;
EBRUSHOBJ eboFill;
POINTL BrushOrigin;
BOOL ret = TRUE;
@ -968,7 +968,7 @@ IntPatBlt(
BrushOrigin.x = BrushObj->ptOrigin.x + dc->ptlDCOrig.x;
BrushOrigin.y = BrushObj->ptOrigin.y + dc->ptlDCOrig.y;
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->rosdc.XlateBrush);
IntGdiInitBrushInstance(&eboFill, BrushObj, dc->rosdc.XlateBrush);
ret = IntEngBitBlt(
&psurf->SurfObj,
@ -979,7 +979,7 @@ IntPatBlt(
&DestRect,
NULL,
NULL,
&BrushInst.BrushObject, // use pDC->eboFill
&eboFill.BrushObject, // use pDC->eboFill
&BrushOrigin,
ROP3_TO_ROP4(ROP));
}
@ -999,7 +999,7 @@ IntGdiPolyPatBlt(
{
int i;
PPATRECT r;
PGDIBRUSHOBJ BrushObj;
PBRUSH pbrush;
PDC_ATTR pdcattr;
DC *dc;
@ -1023,8 +1023,8 @@ IntGdiPolyPatBlt(
for (r = pRects, i = 0; i < cRects; i++)
{
BrushObj = BRUSHOBJ_LockBrush(r->hBrush);
if(BrushObj != NULL)
pbrush = BRUSH_LockBrush(r->hBrush);
if(pbrush != NULL)
{
IntPatBlt(
dc,
@ -1033,8 +1033,8 @@ IntGdiPolyPatBlt(
r->r.right,
r->r.bottom,
dwRop,
BrushObj);
BRUSHOBJ_UnlockBrush(BrushObj);
pbrush);
BRUSH_UnlockBrush(pbrush);
}
r++;
}
@ -1054,7 +1054,7 @@ NtGdiPatBlt(
INT Height,
DWORD ROP)
{
PGDIBRUSHOBJ BrushObj;
PBRUSH pbrush;
DC *dc;
PDC_ATTR pdcattr;
BOOL ret;
@ -1084,8 +1084,8 @@ NtGdiPatBlt(
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
IntGdiSelectBrush(dc,pdcattr->hbrush);
BrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
if (BrushObj == NULL)
pbrush = BRUSH_LockBrush(pdcattr->hbrush);
if (pbrush == NULL)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
DC_UnlockDc(dc);
@ -1099,9 +1099,9 @@ NtGdiPatBlt(
Width,
Height,
ROP,
BrushObj);
pbrush);
BRUSHOBJ_UnlockBrush(BrushObj);
BRUSH_UnlockBrush(pbrush);
DC_UnlockDc(dc);
return ret;

View file

@ -655,22 +655,22 @@ GdiSetPixelV(
INT Y,
COLORREF Color)
{
HBRUSH NewBrush = NtGdiCreateSolidBrush(Color, NULL);
HBRUSH hbrush = NtGdiCreateSolidBrush(Color, NULL);
HGDIOBJ OldBrush;
if (NewBrush == NULL)
if (hbrush == NULL)
return(FALSE);
OldBrush = NtGdiSelectBrush(hDC, NewBrush);
OldBrush = NtGdiSelectBrush(hDC, hbrush);
if (OldBrush == NULL)
{
NtGdiDeleteObject(NewBrush);
NtGdiDeleteObject(hbrush);
return(FALSE);
}
NtGdiPatBlt(hDC, X, Y, 1, 1, PATCOPY);
NtGdiSelectBrush(hDC, OldBrush);
NtGdiDeleteObject(NewBrush);
NtGdiDeleteObject(hbrush);
return TRUE;
}
@ -909,7 +909,7 @@ NtGdiSelectBitmap(
PSURFACE psurfBmp;
HRGN hVisRgn;
BOOLEAN bFailed;
PGDIBRUSHOBJ pBrush;
PBRUSH pbrush;
if (hDC == NULL || hBmp == NULL) return NULL;
@ -962,26 +962,26 @@ NtGdiSelectBitmap(
SURFACE_UnlockSurface(psurfBmp);
/* Regenerate the XLATEOBJs. */
pBrush = BRUSHOBJ_LockBrush(pdcattr->hbrush);
if (pBrush)
pbrush = BRUSH_LockBrush(pdcattr->hbrush);
if (pbrush)
{
if (pDC->rosdc.XlateBrush)
{
EngDeleteXlate(pDC->rosdc.XlateBrush);
}
pDC->rosdc.XlateBrush = IntGdiCreateBrushXlate(pDC, pBrush, &bFailed);
BRUSHOBJ_UnlockBrush(pBrush);
pDC->rosdc.XlateBrush = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed);
BRUSH_UnlockBrush(pbrush);
}
pBrush = PENOBJ_LockPen(pdcattr->hpen);
if (pBrush)
pbrush = PENOBJ_LockPen(pdcattr->hpen);
if (pbrush)
{
if (pDC->rosdc.XlatePen)
{
EngDeleteXlate(pDC->rosdc.XlatePen);
}
pDC->rosdc.XlatePen = IntGdiCreateBrushXlate(pDC, pBrush, &bFailed);
PENOBJ_UnlockPen(pBrush);
pDC->rosdc.XlatePen = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed);
PENOBJ_UnlockPen(pbrush);
}
DC_UnlockDc(pDC);

View file

@ -38,37 +38,37 @@ static const USHORT HatchBrushes[NB_HATCH_STYLES][8] =
BOOL INTERNAL_CALL
BRUSH_Cleanup(PVOID ObjectBody)
{
PGDIBRUSHOBJ pBrush = (PGDIBRUSHOBJ)ObjectBody;
if(pBrush->flAttrs & (GDIBRUSH_IS_HATCH | GDIBRUSH_IS_BITMAP))
PBRUSH pbrush = (PBRUSH)ObjectBody;
if(pbrush->flAttrs & (GDIBRUSH_IS_HATCH | GDIBRUSH_IS_BITMAP))
{
ASSERT(pBrush->hbmPattern);
GDIOBJ_SetOwnership(pBrush->hbmPattern, PsGetCurrentProcess());
NtGdiDeleteObject(pBrush->hbmPattern);
ASSERT(pbrush->hbmPattern);
GDIOBJ_SetOwnership(pbrush->hbmPattern, PsGetCurrentProcess());
NtGdiDeleteObject(pbrush->hbmPattern);
}
/* Free the kmode styles array of EXTPENS */
if (pBrush->pStyle)
if (pbrush->pStyle)
{
ExFreePool(pBrush->pStyle);
ExFreePool(pbrush->pStyle);
}
return TRUE;
}
INT FASTCALL
BRUSH_GetObject (PGDIBRUSHOBJ BrushObject, INT Count, LPLOGBRUSH Buffer)
BRUSH_GetObject (PBRUSH pbrush, INT Count, LPLOGBRUSH Buffer)
{
if( Buffer == NULL ) return sizeof(LOGBRUSH);
if (Count == 0) return 0;
/* Set colour */
Buffer->lbColor = BrushObject->BrushAttr.lbColor;
Buffer->lbColor = pbrush->BrushAttr.lbColor;
/* set Hatch */
if ((BrushObject->flAttrs & GDIBRUSH_IS_HATCH)!=0)
if ((pbrush->flAttrs & GDIBRUSH_IS_HATCH)!=0)
{
/* FIXME : this is not the right value */
Buffer->lbHatch = (LONG)BrushObject->hbmPattern;
Buffer->lbHatch = (LONG)pbrush->hbmPattern;
}
else
{
@ -78,33 +78,33 @@ BRUSH_GetObject (PGDIBRUSHOBJ BrushObject, INT Count, LPLOGBRUSH Buffer)
Buffer->lbStyle = 0;
/* Get the type of style */
if ((BrushObject->flAttrs & GDIBRUSH_IS_SOLID)!=0)
if ((pbrush->flAttrs & GDIBRUSH_IS_SOLID)!=0)
{
Buffer->lbStyle = BS_SOLID;
}
else if ((BrushObject->flAttrs & GDIBRUSH_IS_NULL)!=0)
else if ((pbrush->flAttrs & GDIBRUSH_IS_NULL)!=0)
{
Buffer->lbStyle = BS_NULL; // BS_HOLLOW
}
else if ((BrushObject->flAttrs & GDIBRUSH_IS_HATCH)!=0)
else if ((pbrush->flAttrs & GDIBRUSH_IS_HATCH)!=0)
{
Buffer->lbStyle = BS_HATCHED;
}
else if ((BrushObject->flAttrs & GDIBRUSH_IS_BITMAP)!=0)
else if ((pbrush->flAttrs & GDIBRUSH_IS_BITMAP)!=0)
{
Buffer->lbStyle = BS_PATTERN;
}
else if ((BrushObject->flAttrs & GDIBRUSH_IS_DIB)!=0)
else if ((pbrush->flAttrs & GDIBRUSH_IS_DIB)!=0)
{
Buffer->lbStyle = BS_DIBPATTERN;
}
/* FIXME
else if ((BrushObject->flAttrs & )!=0)
else if ((pbrush->flAttrs & )!=0)
{
Buffer->lbStyle = BS_INDEXED;
}
else if ((BrushObject->flAttrs & )!=0)
else if ((pbrush->flAttrs & )!=0)
{
Buffer->lbStyle = BS_DIBPATTERNPT;
}
@ -116,7 +116,7 @@ BRUSH_GetObject (PGDIBRUSHOBJ BrushObject, INT Count, LPLOGBRUSH Buffer)
XLATEOBJ* FASTCALL
IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
IntGdiCreateBrushXlate(PDC Dc, BRUSH *pbrush, BOOLEAN *Failed)
{
XLATEOBJ *Result = NULL;
SURFACE * psurf;
@ -130,19 +130,19 @@ IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
}
if (!hPalette) hPalette = pPrimarySurface->DevInfo.hpalDefault;
if (BrushObj->flAttrs & GDIBRUSH_IS_NULL)
if (pbrush->flAttrs & GDIBRUSH_IS_NULL)
{
Result = NULL;
*Failed = FALSE;
}
else if (BrushObj->flAttrs & GDIBRUSH_IS_SOLID)
else if (pbrush->flAttrs & GDIBRUSH_IS_SOLID)
{
Result = IntEngCreateXlate(0, PAL_RGB, hPalette, NULL);
*Failed = FALSE;
}
else
{
SURFACE *Pattern = SURFACE_LockSurface(BrushObj->hbmPattern);
SURFACE *Pattern = SURFACE_LockSurface(pbrush->hbmPattern);
if (Pattern == NULL)
return NULL;
@ -152,9 +152,9 @@ IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
PDC_ATTR pdcattr = Dc->pdcattr;
if (Dc->rosdc.bitsPerPixel != 1)
Result = IntEngCreateSrcMonoXlate(hPalette, pdcattr->crBackgroundClr, BrushObj->BrushAttr.lbColor);
Result = IntEngCreateSrcMonoXlate(hPalette, pdcattr->crBackgroundClr, pbrush->BrushAttr.lbColor);
}
else if (BrushObj->flAttrs & GDIBRUSH_IS_DIB)
else if (pbrush->flAttrs & GDIBRUSH_IS_DIB)
{
Result = IntEngCreateXlate(0, 0, hPalette, Pattern->hDIBPalette);
}
@ -167,26 +167,26 @@ IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
}
VOID FASTCALL
IntGdiInitBrushInstance(GDIBRUSHINST *BrushInst, PGDIBRUSHOBJ BrushObj, XLATEOBJ *XlateObj)
IntGdiInitBrushInstance(EBRUSHOBJ *BrushInst, PBRUSH pbrush, XLATEOBJ *XlateObj)
{
ASSERT(BrushInst);
ASSERT(BrushObj);
if (BrushObj->flAttrs & GDIBRUSH_IS_NULL)
ASSERT(pbrush);
if (pbrush->flAttrs & GDIBRUSH_IS_NULL)
{
BrushInst->BrushObject.iSolidColor = 0;
}
else if (BrushObj->flAttrs & GDIBRUSH_IS_SOLID)
else if (pbrush->flAttrs & GDIBRUSH_IS_SOLID)
{
BrushInst->BrushObject.iSolidColor = XLATEOBJ_iXlate(XlateObj, BrushObj->BrushAttr.lbColor);
BrushInst->BrushObject.iSolidColor = XLATEOBJ_iXlate(XlateObj, pbrush->BrushAttr.lbColor);
}
else
{
BrushInst->BrushObject.iSolidColor = 0xFFFFFFFF;
}
BrushInst->BrushObject.pvRbrush = BrushObj->ulRealization;
BrushInst->BrushObject.pvRbrush = pbrush->ulRealization;
BrushInst->BrushObject.flColorType = 0;
BrushInst->GdiBrushObject = BrushObj;
BrushInst->GdiBrushObject = pbrush;
BrushInst->XlateObject = XlateObj;
}
@ -325,7 +325,7 @@ IntGdiCreateDIBBrush(
CONST VOID *PackedDIB)
{
HBRUSH hBrush;
PGDIBRUSHOBJ BrushObject;
PBRUSH pbrush;
HBITMAP hPattern;
ULONG_PTR DataPtr;
UINT PaletteEntryCount;
@ -367,22 +367,22 @@ IntGdiCreateDIBBrush(
psurfPattern->hDIBPalette = BuildDIBPalette(BitmapInfo, &PaletteType);
SURFACE_UnlockSurface(psurfPattern);
BrushObject = BRUSHOBJ_AllocBrushWithHandle();
if (BrushObject == NULL)
pbrush = BRUSH_AllocBrushWithHandle();
if (pbrush == NULL)
{
NtGdiDeleteObject(hPattern);
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
hBrush = BrushObject->BaseObject.hHmgr;
hBrush = pbrush->BaseObject.hHmgr;
BrushObject->flAttrs |= GDIBRUSH_IS_BITMAP | GDIBRUSH_IS_DIB;
BrushObject->hbmPattern = hPattern;
pbrush->flAttrs |= GDIBRUSH_IS_BITMAP | GDIBRUSH_IS_DIB;
pbrush->hbmPattern = hPattern;
/* FIXME: Fill in the rest of fields!!! */
GDIOBJ_SetOwnership(hPattern, NULL);
BRUSHOBJ_UnlockBrush(BrushObject);
BRUSH_UnlockBrush(pbrush);
return hBrush;
}
@ -393,7 +393,7 @@ IntGdiCreateHatchBrush(
COLORREF Color)
{
HBRUSH hBrush;
PGDIBRUSHOBJ BrushObject;
PBRUSH pbrush;
HBITMAP hPattern;
if (Style < 0 || Style >= NB_HATCH_STYLES)
@ -408,22 +408,22 @@ IntGdiCreateHatchBrush(
return NULL;
}
BrushObject = BRUSHOBJ_AllocBrushWithHandle();
if (BrushObject == NULL)
pbrush = BRUSH_AllocBrushWithHandle();
if (pbrush == NULL)
{
NtGdiDeleteObject(hPattern);
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
hBrush = BrushObject->BaseObject.hHmgr;
hBrush = pbrush->BaseObject.hHmgr;
BrushObject->flAttrs |= GDIBRUSH_IS_HATCH;
BrushObject->hbmPattern = hPattern;
BrushObject->BrushAttr.lbColor = Color & 0xFFFFFF;
pbrush->flAttrs |= GDIBRUSH_IS_HATCH;
pbrush->hbmPattern = hPattern;
pbrush->BrushAttr.lbColor = Color & 0xFFFFFF;
GDIOBJ_SetOwnership(hPattern, NULL);
BRUSHOBJ_UnlockBrush(BrushObject);
BRUSH_UnlockBrush(pbrush);
return hBrush;
}
@ -433,7 +433,7 @@ IntGdiCreatePatternBrush(
HBITMAP hBitmap)
{
HBRUSH hBrush;
PGDIBRUSHOBJ BrushObject;
PBRUSH pbrush;
HBITMAP hPattern;
hPattern = BITMAP_CopyBitmap(hBitmap);
@ -443,22 +443,22 @@ IntGdiCreatePatternBrush(
return NULL;
}
BrushObject = BRUSHOBJ_AllocBrushWithHandle();
if (BrushObject == NULL)
pbrush = BRUSH_AllocBrushWithHandle();
if (pbrush == NULL)
{
NtGdiDeleteObject(hPattern);
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
hBrush = BrushObject->BaseObject.hHmgr;
hBrush = pbrush->BaseObject.hHmgr;
BrushObject->flAttrs |= GDIBRUSH_IS_BITMAP;
BrushObject->hbmPattern = hPattern;
pbrush->flAttrs |= GDIBRUSH_IS_BITMAP;
pbrush->hbmPattern = hPattern;
/* FIXME: Fill in the rest of fields!!! */
GDIOBJ_SetOwnership(hPattern, NULL);
BRUSHOBJ_UnlockBrush(BrushObject);
BRUSH_UnlockBrush(pbrush);
return hBrush;
}
@ -468,22 +468,22 @@ IntGdiCreateSolidBrush(
COLORREF Color)
{
HBRUSH hBrush;
PGDIBRUSHOBJ BrushObject;
PBRUSH pbrush;
BrushObject = BRUSHOBJ_AllocBrushWithHandle();
if (BrushObject == NULL)
pbrush = BRUSH_AllocBrushWithHandle();
if (pbrush == NULL)
{
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
hBrush = BrushObject->BaseObject.hHmgr;
hBrush = pbrush->BaseObject.hHmgr;
BrushObject->flAttrs |= GDIBRUSH_IS_SOLID;
pbrush->flAttrs |= GDIBRUSH_IS_SOLID;
BrushObject->BrushAttr.lbColor = Color;
pbrush->BrushAttr.lbColor = Color;
/* FIXME: Fill in the rest of fields!!! */
BRUSHOBJ_UnlockBrush(BrushObject);
BRUSH_UnlockBrush(pbrush);
return hBrush;
}
@ -492,18 +492,18 @@ HBRUSH APIENTRY
IntGdiCreateNullBrush(VOID)
{
HBRUSH hBrush;
PGDIBRUSHOBJ BrushObject;
PBRUSH pbrush;
BrushObject = BRUSHOBJ_AllocBrushWithHandle();
if (BrushObject == NULL)
pbrush = BRUSH_AllocBrushWithHandle();
if (pbrush == NULL)
{
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
hBrush = BrushObject->BaseObject.hHmgr;
hBrush = pbrush->BaseObject.hHmgr;
BrushObject->flAttrs |= GDIBRUSH_IS_NULL;
BRUSHOBJ_UnlockBrush(BrushObject);
pbrush->flAttrs |= GDIBRUSH_IS_NULL;
BRUSH_UnlockBrush(pbrush);
return hBrush;
}
@ -516,7 +516,7 @@ IntGdiSelectBrush(
{
PDC_ATTR pdcattr;
HBRUSH hOrgBrush;
PGDIBRUSHOBJ pBrush;
PBRUSH pbrush;
XLATEOBJ *XlateObj;
BOOLEAN bFailed;
@ -524,15 +524,15 @@ IntGdiSelectBrush(
pdcattr = pDC->pdcattr;
pBrush = BRUSHOBJ_LockBrush(hBrush);
if (pBrush == NULL)
pbrush = BRUSH_LockBrush(hBrush);
if (pbrush == NULL)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return NULL;
}
XlateObj = IntGdiCreateBrushXlate(pDC, pBrush, &bFailed);
BRUSHOBJ_UnlockBrush(pBrush);
XlateObj = IntGdiCreateBrushXlate(pDC, pbrush, &bFailed);
BRUSH_UnlockBrush(pbrush);
if(bFailed)
{
return NULL;
@ -689,14 +689,14 @@ NtGdiSetBrushOrg(HDC hDC, INT XOrg, INT YOrg, LPPOINT Point)
VOID FASTCALL
IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color)
{
PGDIBRUSHOBJ BrushObject;
PBRUSH pbrush;
BrushObject = BRUSHOBJ_LockBrush(hBrush);
if (BrushObject->flAttrs & GDIBRUSH_IS_SOLID)
pbrush = BRUSH_LockBrush(hBrush);
if (pbrush->flAttrs & GDIBRUSH_IS_SOLID)
{
BrushObject->BrushAttr.lbColor = Color & 0xFFFFFF;
pbrush->BrushAttr.lbColor = Color & 0xFFFFFF;
}
BRUSHOBJ_UnlockBrush(BrushObject);
BRUSH_UnlockBrush(pbrush);
}
/*

View file

@ -63,8 +63,8 @@ typedef struct _Rect
int width, height; /* width and height of rect */
} Rect, *PRect;
int FASTCALL IntFillRect(DC *dc, INT XLeft, INT YLeft, INT Width, INT Height, PGDIBRUSHOBJ BrushObj, BOOL Pen);
int FASTCALL app_fill_rect(DC *dc, Rect r, PGDIBRUSHOBJ BrushObj, BOOL Pen);
int FASTCALL IntFillRect(DC *dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush, BOOL Pen);
int FASTCALL app_fill_rect(DC *dc, Rect r, PBRUSH pbrush, BOOL Pen);
static
POINT
@ -121,7 +121,7 @@ rect(int x, int y, int width, int height)
static
int
INTERNAL_CALL
app_draw_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
{
/* Outer ellipse: e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */
@ -139,7 +139,7 @@ app_draw_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
int d2xt = b2+b2;
int d2yt = a2+a2;
int w = BrushObj->ptPenWidth.x;
int w = pbrush->ptPenWidth.x;
/* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */
@ -165,7 +165,7 @@ app_draw_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
// START_DEBUG();
if ((r.width <= 2) || (r.height <= 2))
return app_fill_rect(g, r, BrushObj, TRUE);
return app_fill_rect(g, r, pbrush, TRUE);
r1.x = r.x + a;
r1.y = r.y;
@ -264,8 +264,8 @@ app_draw_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
if ((r1.y < r.y+w) || (r1.x+W >= r1.x+r1.width-W))
{
result &= app_fill_rect(g, r1, BrushObj, TRUE);
result &= app_fill_rect(g, r2, BrushObj, TRUE);
result &= app_fill_rect(g, r1, pbrush, TRUE);
result &= app_fill_rect(g, r2, pbrush, TRUE);
prevx = r1.x;
prevy = r1.y;
@ -274,13 +274,13 @@ app_draw_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
{
/* draw distinct rectangles */
result &= app_fill_rect(g, rect(r1.x,r1.y,
W,1), BrushObj, TRUE);
W,1), pbrush, TRUE);
result &= app_fill_rect(g, rect(
r1.x+r1.width-W,r1.y,W,1), BrushObj, TRUE);
r1.x+r1.width-W,r1.y,W,1), pbrush, TRUE);
result &= app_fill_rect(g, rect(r2.x,
r2.y,W,1), BrushObj, TRUE);
r2.y,W,1), pbrush, TRUE);
result &= app_fill_rect(g, rect(
r2.x+r2.width-W,r2.y,W,1), BrushObj, TRUE);
r2.x+r2.width-W,r2.y,W,1), pbrush, TRUE);
prevx = r1.x;
prevy = r1.y;
@ -310,13 +310,13 @@ app_draw_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
if (W+W >= r.width) {
result &= app_fill_rect(g, rect(r.x, r1.y,
r.width, r1.height), BrushObj, TRUE);
r.width, r1.height), pbrush, TRUE);
return result;
}
result &= app_fill_rect(g, rect(r.x, r1.y, W, r1.height), BrushObj, TRUE);
result &= app_fill_rect(g, rect(r.x, r1.y, W, r1.height), pbrush, TRUE);
result &= app_fill_rect(g, rect(r.x+r.width-W, r1.y,
W, r1.height), BrushObj, TRUE);
W, r1.height), pbrush, TRUE);
}
return result;
}
@ -364,7 +364,7 @@ app_fill_arc_rect(DC *g,
POINT p2, // End
int start_angle,
int end_angle,
PGDIBRUSHOBJ BrushObj,
PBRUSH pbrush,
BOOL Pen)
{
int x1, x2;
@ -440,36 +440,36 @@ app_fill_arc_rect(DC *g,
{
/* fill outsides of wedge */
if (! app_fill_rect(g, rect(r.x, r.y,
x1-r.x, r.height), BrushObj, Pen))
x1-r.x, r.height), pbrush, Pen))
return 0;
return app_fill_rect(g, rect(x2, r.y,
r.x+r.width-x2, r.height), BrushObj, Pen);
r.x+r.width-x2, r.height), pbrush, Pen);
}
else
{
/* fill inside of wedge */
r.width = x1-x2;
r.x = x2;
return app_fill_rect(g, r, BrushObj, Pen);
return app_fill_rect(g, r, pbrush, Pen);
}
}
else if (start_above)
{
/* fill to the left of the start_line */
r.width = x1-r.x;
return app_fill_rect(g, r, BrushObj, Pen);
return app_fill_rect(g, r, pbrush, Pen);
}
else if (end_above)
{
/* fill right of end_line */
r.width = r.x+r.width-x2;
r.x = x2;
return app_fill_rect(g, r, BrushObj, Pen);
return app_fill_rect(g, r, pbrush, Pen);
}
else
{
if (start_angle > end_angle)
return app_fill_rect(g,r, BrushObj, Pen);
return app_fill_rect(g,r, pbrush, Pen);
else
return 1;
}
@ -535,7 +535,7 @@ app_fill_arc_rect(DC *g,
if (start_above && end_above)
{
if (start_angle > end_angle)
return app_fill_rect(g,r, BrushObj, Pen);
return app_fill_rect(g,r, pbrush, Pen);
else
return 1;
}
@ -543,14 +543,14 @@ app_fill_arc_rect(DC *g,
{
/* fill to the left of end_line */
r.width = x2-r.x;
return app_fill_rect(g,r, BrushObj, Pen);
return app_fill_rect(g,r, pbrush, Pen);
}
else if (end_above)
{
/* fill right of start_line */
r.width = r.x+r.width-x1;
r.x = x1;
return app_fill_rect(g,r, BrushObj, Pen);
return app_fill_rect(g,r, pbrush, Pen);
}
else
{
@ -558,17 +558,17 @@ app_fill_arc_rect(DC *g,
{
/* fill outsides of wedge */
if (! app_fill_rect(g, rect(r.x, r.y,
x2-r.x, r.height), BrushObj, Pen))
x2-r.x, r.height), pbrush, Pen))
return 0;
return app_fill_rect(g, rect(x1, r.y,
r.x+r.width-x1, r.height), BrushObj, Pen);
r.x+r.width-x1, r.height), pbrush, Pen);
}
else
{
/* fill inside of wedge */
r.width = x2-x1;
r.x = x1;
return app_fill_rect(g, r, BrushObj, Pen);
return app_fill_rect(g, r, pbrush, Pen);
}
}
}
@ -604,7 +604,7 @@ app_fill_arc_rect(DC *g,
static
int
FASTCALL
app_fill_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
{
/* e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */
@ -627,7 +627,7 @@ app_fill_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
// START_DEBUG();
if ((r.width <= 2) || (r.height <= 2))
return app_fill_rect(g, r, BrushObj, FALSE);
return app_fill_rect(g, r, pbrush, FALSE);
r1.x = r.x + a;
r1.y = r.y;
@ -673,8 +673,8 @@ app_fill_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
if (r1.y+r1.height < r2.y) {
/* distinct rectangles */
result &= app_fill_rect(g, r1, BrushObj, FALSE);
result &= app_fill_rect(g, r2, BrushObj, FALSE);
result &= app_fill_rect(g, r1, pbrush, FALSE);
result &= app_fill_rect(g, r2, pbrush, FALSE);
}
/* move down */
@ -699,7 +699,7 @@ app_fill_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
r1.x = r.x;
r1.width = r.width;
r1.height = r2.y+r2.height-r1.y;
result &= app_fill_rect(g, r1, BrushObj, FALSE);
result &= app_fill_rect(g, r1, pbrush, FALSE);
}
else if (x <= a) {
/* crossover, draw final line */
@ -707,7 +707,7 @@ app_fill_ellipse(DC *g, Rect r, PGDIBRUSHOBJ BrushObj)
r1.width = r.width;
r1.height = r1.y+r1.height-r2.y;
r1.y = r2.y;
result &= app_fill_rect(g, r1, BrushObj, FALSE);
result &= app_fill_rect(g, r1, pbrush, FALSE);
}
return result;
}
@ -758,7 +758,7 @@ POINT app_boundary_point(Rect r, int angle)
int
FASTCALL
app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ BrushObj, BOOL Chord)
app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL Chord)
{
/* e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */
@ -788,7 +788,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ BrushOb
if ((start_angle + 360 <= end_angle) ||
(start_angle - 360 >= end_angle))
{
return app_fill_ellipse(g, r, BrushObj);
return app_fill_ellipse(g, r, pbrush);
}
/* make start_angle >= 0 and <= 360 */
@ -874,10 +874,10 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ BrushOb
/* distinct rectangles */
result &= app_fill_arc_rect(g, r1,
p0, p1, p2,
start_angle, end_angle, BrushObj, FALSE);
start_angle, end_angle, pbrush, FALSE);
result &= app_fill_arc_rect(g, r2,
p0, p1, p2,
start_angle, end_angle, BrushObj, FALSE);
start_angle, end_angle, pbrush, FALSE);
}
/* move down */
@ -899,7 +899,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ BrushOb
while (r1.height > 0) {
result &= app_fill_arc_rect(g,
rect(r1.x, r1.y, r1.width, 1),
p0, p1, p2, start_angle, end_angle, BrushObj, FALSE);
p0, p1, p2, start_angle, end_angle, pbrush, FALSE);
r1.y += 1;
r1.height -= 1;
}
@ -913,7 +913,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ BrushOb
while (r1.height > 0) {
result &= app_fill_arc_rect(g,
rect(r1.x, r1.y, r1.width, 1),
p0, p1, p2, start_angle, end_angle, BrushObj, FALSE);
p0, p1, p2, start_angle, end_angle, pbrush, FALSE);
r1.y += 1;
r1.height -= 1;
}
@ -921,7 +921,7 @@ app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ BrushOb
return result;
}
int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ PenBrushObj, BOOL Chord)
int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen, BOOL Chord)
{
/* Outer ellipse: e(x,y) = b*b*x*x + a*a*y*y - a*a*b*b */
@ -939,7 +939,7 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ Pen
int d2xt = b2+b2;
int d2yt = a2+a2;
int w = PenBrushObj->ptPenWidth.x;
int w = pbrushPen->ptPenWidth.x;
/* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */
@ -972,7 +972,7 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ Pen
if ((start_angle + 360 <= end_angle) ||
(start_angle - 360 >= end_angle))
{
return app_draw_ellipse(g, r, PenBrushObj);
return app_draw_ellipse(g, r, pbrushPen);
}
/* make start_angle >= 0 and <= 360 */
@ -1097,10 +1097,10 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ Pen
{
result &= app_fill_arc_rect(g, r1,
p0, p1, p2,
start_angle, end_angle, PenBrushObj, TRUE);
start_angle, end_angle, pbrushPen, TRUE);
result &= app_fill_arc_rect(g, r2,
p0, p1, p2,
start_angle, end_angle, PenBrushObj, TRUE);
start_angle, end_angle, pbrushPen, TRUE);
prevx = r1.x;
prevy = r1.y;
@ -1111,19 +1111,19 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ Pen
result &= app_fill_arc_rect(g, rect(
r1.x,r1.y,W,1),
p0, p1, p2,
start_angle, end_angle, PenBrushObj, TRUE);
start_angle, end_angle, pbrushPen, TRUE);
result &= app_fill_arc_rect(g, rect(
r1.x+r1.width-W,r1.y,W,1),
p0, p1, p2,
start_angle, end_angle, PenBrushObj, TRUE);
start_angle, end_angle, pbrushPen, TRUE);
result &= app_fill_arc_rect(g, rect(
r2.x,r2.y,W,1),
p0, p1, p2,
start_angle, end_angle, PenBrushObj, TRUE);
start_angle, end_angle, pbrushPen, TRUE);
result &= app_fill_arc_rect(g, rect(
r2.x+r2.width-W,r2.y,W,1),
p0, p1, p2,
start_angle, end_angle, PenBrushObj, TRUE);
start_angle, end_angle, pbrushPen, TRUE);
prevx = r1.x;
prevy = r1.y;
@ -1155,7 +1155,7 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ Pen
while (r1.height > 0) {
result &= app_fill_arc_rect(g, rect(r.x,
r1.y, r.width, 1), p0, p1, p2,
start_angle, end_angle, PenBrushObj, TRUE);
start_angle, end_angle, pbrushPen, TRUE);
r1.y += 1;
r1.height -= 1;
}
@ -1165,10 +1165,10 @@ int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PGDIBRUSHOBJ Pen
while (r1.height > 0) {
result &= app_fill_arc_rect(g, rect(r.x, r1.y,
W, 1), p0, p1, p2,
start_angle, end_angle, PenBrushObj, TRUE);
start_angle, end_angle, pbrushPen, TRUE);
result &= app_fill_arc_rect(g, rect(r.x+r.width-W,
r1.y, W, 1), p0, p1, p2,
start_angle, end_angle, PenBrushObj, TRUE);
start_angle, end_angle, pbrushPen, TRUE);
r1.y += 1;
r1.height -= 1;
}
@ -1186,18 +1186,18 @@ IntFillRect( DC *dc,
INT YLeft,
INT Width,
INT Height,
PGDIBRUSHOBJ BrushObj,
PBRUSH pbrush,
BOOL Pen)
{
DWORD ROP = PATCOPY;
RECTL DestRect;
SURFACE *psurf;
GDIBRUSHINST BrushInst;
EBRUSHOBJ eboFill;
POINTL BrushOrigin;
BOOL Ret = TRUE;
PDC_ATTR pdcattr;
ASSERT(BrushObj);
ASSERT(pbrush);
psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
if (psurf == NULL)
@ -1206,7 +1206,7 @@ IntFillRect( DC *dc,
return 0;
}
if (!(BrushObj->flAttrs & GDIBRUSH_IS_NULL))
if (!(pbrush->flAttrs & GDIBRUSH_IS_NULL))
{
pdcattr = dc->pdcattr;
@ -1228,8 +1228,8 @@ IntFillRect( DC *dc,
DestRect.top = YLeft;
DestRect.bottom = YLeft + Height;
BrushOrigin.x = BrushObj->ptOrigin.x;
BrushOrigin.y = BrushObj->ptOrigin.y;
BrushOrigin.x = pbrush->ptOrigin.x;
BrushOrigin.y = pbrush->ptOrigin.y;
if (pdcattr->jROP2 == R2_XORPEN)
ROP = PATINVERT;
@ -1237,9 +1237,9 @@ IntFillRect( DC *dc,
ROP = PATCOPY;
if (Pen)
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->rosdc.XlatePen);
IntGdiInitBrushInstance(&eboFill, pbrush, dc->rosdc.XlatePen);
else
IntGdiInitBrushInstance(&BrushInst, BrushObj, dc->rosdc.XlateBrush);
IntGdiInitBrushInstance(&eboFill, pbrush, dc->rosdc.XlateBrush);
Ret = IntEngBitBlt(
&psurf->SurfObj,
@ -1250,7 +1250,7 @@ IntFillRect( DC *dc,
&DestRect,
NULL,
NULL,
&BrushInst.BrushObject, // use pDC->eboFill
&eboFill.BrushObject, // use pDC->eboFill
&BrushOrigin,
ROP3_TO_ROP4(ROP));
}
@ -1271,15 +1271,15 @@ IntFillArc( PDC dc,
ARCTYPE arctype)
{
PDC_ATTR pdcattr;
PGDIBRUSHOBJ FillBrushObj;
PBRUSH pbrush;
int Start = ceill(StartArc);
int End = ceill(EndArc);
BOOL Chord = (arctype == GdiTypeChord), ret;
pdcattr = dc->pdcattr;
FillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
if (NULL == FillBrushObj)
pbrush = BRUSH_LockBrush(pdcattr->hbrush);
if (!pbrush)
{
DPRINT1("FillArc Fail\n");
SetLastWin32Error(ERROR_INTERNAL_ERROR);
@ -1289,9 +1289,9 @@ IntFillArc( PDC dc,
ret = app_fill_arc(dc, rect( XLeft, YLeft, Width, Height),
(dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -End : -Start,
(dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End,
FillBrushObj, Chord);
pbrush, Chord);
BRUSHOBJ_UnlockBrush(FillBrushObj);
BRUSH_UnlockBrush(pbrush);
return ret;
}
@ -1305,7 +1305,7 @@ IntDrawArc( PDC dc,
double StartArc,
double EndArc,
ARCTYPE arctype,
PGDIBRUSHOBJ PenBrushObj)
PBRUSH pbrush)
{
int Start = ceill(StartArc);
int End = ceill(EndArc);
@ -1314,7 +1314,7 @@ IntDrawArc( PDC dc,
return app_draw_arc(dc, rect( XLeft, YLeft, Width, Height),
(dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -End : -Start,
(dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End,
PenBrushObj, Chord);
pbrush, Chord);
}
BOOL
@ -1324,9 +1324,9 @@ IntDrawEllipse( PDC dc,
INT YLeft,
INT Width,
INT Height,
PGDIBRUSHOBJ PenBrushObj)
PBRUSH pbrush)
{
return (BOOL)app_draw_ellipse(dc, rect( XLeft, YLeft, Width, Height), PenBrushObj);
return (BOOL)app_draw_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush);
}
BOOL
@ -1336,9 +1336,9 @@ IntFillEllipse( PDC dc,
INT YLeft,
INT Width,
INT Height,
PGDIBRUSHOBJ FillBrushObj)
PBRUSH pbrush)
{
return (BOOL)app_fill_ellipse(dc, rect( XLeft, YLeft, Width, Height), FillBrushObj);
return (BOOL)app_fill_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush);
}
BOOL
@ -1350,7 +1350,7 @@ IntFillRoundRect( PDC dc,
INT Bottom,
INT Wellipse,
INT Hellipse,
PGDIBRUSHOBJ FillBrushObj)
PBRUSH pbrush)
{
Rect r;
int rx, ry; /* radius in x and y directions */
@ -1363,44 +1363,44 @@ IntFillRoundRect( PDC dc,
if (Wellipse > r.width)
{
if (Hellipse > r.height) // > W > H
app_fill_ellipse(dc, r, FillBrushObj);
app_fill_ellipse(dc, r, pbrush);
else // > W < H
{
app_fill_arc(dc, rect( r.x, r.y, r.width - 1, Hellipse),
0, 180, FillBrushObj,FALSE);
0, 180, pbrush,FALSE);
app_fill_arc(dc, rect(r.x, Bottom - Hellipse - 1, r.width - 1, Hellipse),
180, 360, FillBrushObj, FALSE);
180, 360, pbrush, FALSE);
}
}
else if(Hellipse > r.height) // < W > H
{
app_fill_arc(dc, rect(r.x, r.y, Wellipse, r.height - 1),
90, 270, FillBrushObj, FALSE);
90, 270, pbrush, FALSE);
app_fill_arc(dc, rect(Right - Wellipse - 1, r.y, Wellipse, r.height - 1),
270, 90, FillBrushObj,FALSE);
270, 90, pbrush,FALSE);
}
else // < W < H
{
app_fill_arc(dc, rect(r.x, r.y, rx+rx, ry+ry),
90, 180, FillBrushObj, FALSE);
90, 180, pbrush, FALSE);
app_fill_arc(dc, rect(r.x, r.y+r.height-ry-ry, rx+rx, ry+ry),
180, 270, FillBrushObj, FALSE);
180, 270, pbrush, FALSE);
app_fill_arc(dc, rect(r.x+r.width-rx-rx, r.y+r.height-ry-ry, rx+rx, ry+ry),
270, 360, FillBrushObj,FALSE);
270, 360, pbrush,FALSE);
app_fill_arc(dc, rect(r.x+r.width-rx-rx, r.y, rx+rx, ry+ry),
0, 90, FillBrushObj,FALSE);
0, 90, pbrush,FALSE);
}
if (Wellipse < r.width)
{
app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, ry+1), FillBrushObj, FALSE);
app_fill_rect(dc, rect(r.x+rx, r.y+r.height-ry+1, r.width-rx-rx, ry-1), FillBrushObj, FALSE);
app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, ry+1), pbrush, FALSE);
app_fill_rect(dc, rect(r.x+rx, r.y+r.height-ry+1, r.width-rx-rx, ry-1), pbrush, FALSE);
}
if (Hellipse < r.height)
{
app_fill_rect(dc, rect(r.x, r.y+ry+1, r.width, r.height-ry-ry), FillBrushObj, FALSE);
app_fill_rect(dc, rect(r.x, r.y+ry+1, r.width, r.height-ry-ry), pbrush, FALSE);
}
return TRUE;
@ -1416,11 +1416,11 @@ IntDrawRoundRect( PDC dc,
INT Bottom,
INT Wellipse,
INT Hellipse,
PGDIBRUSHOBJ PenBrushObj)
PBRUSH pbrushPen)
{
Rect r;
int rx, ry; /* radius in x and y directions */
int w = PenBrushObj->ptPenWidth.x;
int w = pbrushPen->ptPenWidth.x;
r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top));
rx = Wellipse/2;
@ -1429,50 +1429,50 @@ IntDrawRoundRect( PDC dc,
if (Wellipse > r.width)
{
if (Hellipse > r.height) // > W > H
app_draw_ellipse(dc, r, PenBrushObj);
app_draw_ellipse(dc, r, pbrushPen);
else // > W < H
{
app_draw_arc(dc, rect( r.x, r.y, r.width - 1, Hellipse - 1),
0, 180, PenBrushObj, FALSE);
0, 180, pbrushPen, FALSE);
app_draw_arc(dc, rect(r.x, Bottom - Hellipse, r.width - 1, Hellipse - 1),
180, 360, PenBrushObj, FALSE);
180, 360, pbrushPen, FALSE);
}
}
else if(Hellipse > r.height) // < W > H
{
app_draw_arc(dc, rect(r.x, r.y, Wellipse - 1, r.height - 1),
90, 270, PenBrushObj, FALSE);
90, 270, pbrushPen, FALSE);
app_draw_arc(dc, rect(Right - Wellipse, r.y, Wellipse - 1, r.height - 1),
270, 90, PenBrushObj, FALSE);
270, 90, pbrushPen, FALSE);
}
else // < W < H
{
app_draw_arc(dc, rect(r.x, r.y, rx+rx, ry+ry),
90, 180, PenBrushObj, FALSE);
90, 180, pbrushPen, FALSE);
app_draw_arc(dc, rect(r.x,r.y+r.height-ry-ry,rx+rx,ry+ry),
180, 270, PenBrushObj, FALSE);
180, 270, pbrushPen, FALSE);
app_draw_arc(dc, rect(r.x+r.width-rx-rx, r.y+r.height-ry-ry, rx+rx, ry+ry),
270, 360, PenBrushObj, FALSE);
270, 360, pbrushPen, FALSE);
app_draw_arc(dc, rect(r.x+r.width-rx-rx,r.y,rx+rx,ry+ry),
0, 90, PenBrushObj, FALSE);
0, 90, pbrushPen, FALSE);
}
if ( Hellipse < r.height)
{
app_fill_rect(dc, rect(r.x, r.y+ry+1, w, r.height-ry-ry), PenBrushObj, TRUE);
app_fill_rect(dc, rect(r.x, r.y+ry+1, w, r.height-ry-ry), pbrushPen, TRUE);
app_fill_rect(dc, rect(r.x+r.width-w, r.y+ry+1, w, r.height-ry-ry),
PenBrushObj, TRUE);
pbrushPen, TRUE);
}
if ( Wellipse < r.width)
{
app_fill_rect(dc, rect(r.x+rx, r.y+r.height-w, r.width-rx-rx, w),
PenBrushObj, TRUE);
pbrushPen, TRUE);
app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, w), PenBrushObj, TRUE);
app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, w), pbrushPen, TRUE);
}
return TRUE;
}

View file

@ -25,10 +25,10 @@
#define Rsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0)))
#define Rcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0)))
BOOL FASTCALL IntFillEllipse( PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PGDIBRUSHOBJ FillBrushObj);
BOOL FASTCALL IntDrawEllipse( PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PGDIBRUSHOBJ PenBrushObj);
BOOL FASTCALL IntFillRoundRect( PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PGDIBRUSHOBJ FillBrushObj);
BOOL FASTCALL IntDrawRoundRect( PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PGDIBRUSHOBJ PenBrushObj);
BOOL FASTCALL IntFillEllipse( PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush);
BOOL FASTCALL IntDrawEllipse( PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush);
BOOL FASTCALL IntFillRoundRect( PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrush);
BOOL FASTCALL IntDrawRoundRect( PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrush);
BOOL FASTCALL
IntGdiPolygon(PDC dc,
@ -36,8 +36,8 @@ IntGdiPolygon(PDC dc,
int Count)
{
SURFACE *psurf;
PGDIBRUSHOBJ PenBrushObj, FillBrushObj;
GDIBRUSHINST PenBrushInst, FillBrushInst;
PBRUSH pbrushLine, pbrushFill;
EBRUSHOBJ eboLine, eboFill;
BOOL ret = FALSE; // default to failure
RECTL DestRect;
int CurrentPoint;
@ -95,31 +95,31 @@ IntGdiPolygon(PDC dc,
IntGdiSelectPen(dc,pdcattr->hpen);
/* Special locking order to avoid lock-ups */
FillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
pbrushFill = BRUSH_LockBrush(pdcattr->hbrush);
pbrushLine = PENOBJ_LockPen(pdcattr->hpen);
psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
/* FIXME - psurf can be NULL!!!! don't assert but handle this case gracefully! */
ASSERT(psurf);
/* Now fill the polygon with the current brush. */
if (FillBrushObj && !(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
if (pbrushFill && !(pbrushFill->flAttrs & GDIBRUSH_IS_NULL))
{
BrushOrigin = *((PPOINTL)&FillBrushObj->ptOrigin);
BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin);
BrushOrigin.x += dc->ptlDCOrig.x;
BrushOrigin.y += dc->ptlDCOrig.y;
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->rosdc.XlateBrush);
ret = IntFillPolygon (dc, psurf, &FillBrushInst.BrushObject, Points, Count,
IntGdiInitBrushInstance(&eboFill, pbrushFill, dc->rosdc.XlateBrush);
ret = IntFillPolygon (dc, psurf, &eboFill.BrushObject, Points, Count,
DestRect, &BrushOrigin);
}
if (FillBrushObj)
BRUSHOBJ_UnlockBrush(FillBrushObj);
if (pbrushFill)
BRUSH_UnlockBrush(pbrushFill);
// Draw the Polygon Edges with the current pen ( if not a NULL pen )
if (PenBrushObj && !(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
if (pbrushLine && !(pbrushLine->flAttrs & GDIBRUSH_IS_NULL))
{
int i;
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->rosdc.XlatePen);
IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen);
for (i = 0; i < Count-1; i++)
{
@ -130,7 +130,7 @@ IntGdiPolygon(PDC dc,
ret = IntEngLineTo(&psurf->SurfObj,
dc->rosdc.CombinedClip,
&PenBrushInst.BrushObject,
&eboLine.BrushObject,
Points[i].x, /* From */
Points[i].y,
Points[i+1].x, /* To */
@ -144,7 +144,7 @@ IntGdiPolygon(PDC dc,
{
ret = IntEngLineTo(&psurf->SurfObj,
dc->rosdc.CombinedClip,
&PenBrushInst.BrushObject,
&eboLine.BrushObject,
Points[Count-1].x, /* From */
Points[Count-1].y,
Points[0].x, /* To */
@ -153,8 +153,8 @@ IntGdiPolygon(PDC dc,
ROP2_TO_MIX(pdcattr->jROP2)); /* MIX */
}
}
if (PenBrushObj)
PENOBJ_UnlockPen(PenBrushObj);
if (pbrushLine)
PENOBJ_UnlockPen(pbrushLine);
}
SURFACE_UnlockSurface(psurf);
@ -206,12 +206,12 @@ NtGdiEllipse(
PDC dc;
PDC_ATTR pdcattr;
RECTL RectBounds;
PGDIBRUSHOBJ PenBrushObj;
PBRUSH pbrush;
BOOL ret = TRUE;
LONG PenWidth, PenOrigWidth;
LONG RadiusX, RadiusY, CenterX, CenterY;
PGDIBRUSHOBJ pFillBrushObj;
GDIBRUSHOBJ tmpFillBrushObj;
PBRUSH pFillBrushObj;
BRUSH tmpFillBrushObj;
if ((Left == Right) || (Top == Bottom)) return TRUE;
@ -252,8 +252,8 @@ NtGdiEllipse(
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
IntGdiSelectPen(dc,pdcattr->hpen);
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
if (NULL == PenBrushObj)
pbrush = PENOBJ_LockPen(pdcattr->hpen);
if (!pbrush)
{
DPRINT1("Ellipse Fail 1\n");
DC_UnlockDc(dc);
@ -261,10 +261,10 @@ NtGdiEllipse(
return FALSE;
}
PenOrigWidth = PenWidth = PenBrushObj->ptPenWidth.x;
if (PenBrushObj->ulPenStyle == PS_NULL) PenWidth = 0;
PenOrigWidth = PenWidth = pbrush->ptPenWidth.x;
if (pbrush->ulPenStyle == PS_NULL) PenWidth = 0;
if (PenBrushObj->ulPenStyle == PS_INSIDEFRAME)
if (pbrush->ulPenStyle == PS_INSIDEFRAME)
{
if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2;
if (2*PenWidth > (Bottom - Top)) PenWidth = (Bottom -Top + 1)/2;
@ -275,7 +275,7 @@ NtGdiEllipse(
}
if (!PenWidth) PenWidth = 1;
PenBrushObj->ptPenWidth.x = PenWidth;
pbrush->ptPenWidth.x = PenWidth;
RectBounds.left = Left;
RectBounds.right = Right;
@ -301,7 +301,7 @@ NtGdiEllipse(
DPRINT("Ellipse 2: XLeft: %d, YLeft: %d, Width: %d, Height: %d\n",
CenterX - RadiusX, CenterY + RadiusY, RadiusX*2, RadiusY*2);
pFillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
pFillBrushObj = BRUSH_LockBrush(pdcattr->hbrush);
if (NULL == pFillBrushObj)
{
DPRINT1("FillEllipse Fail\n");
@ -321,7 +321,7 @@ NtGdiEllipse(
RadiusX*2, // Width
RadiusY*2, // Height
&tmpFillBrushObj);
BRUSHOBJ_UnlockBrush(pFillBrushObj);
BRUSH_UnlockBrush(pFillBrushObj);
}
if (ret)
@ -330,10 +330,10 @@ NtGdiEllipse(
CenterY - RadiusY,
RadiusX*2, // Width
RadiusY*2, // Height
PenBrushObj);
pbrush);
PenBrushObj->ptPenWidth.x = PenOrigWidth;
PENOBJ_UnlockPen(PenBrushObj);
pbrush->ptPenWidth.x = PenOrigWidth;
PENOBJ_UnlockPen(pbrush);
DC_UnlockDc(dc);
DPRINT("Ellipse Exit.\n");
return ret;
@ -522,8 +522,8 @@ IntRectangle(PDC dc,
int BottomRect)
{
SURFACE *psurf = NULL;
PGDIBRUSHOBJ PenBrushObj = NULL, FillBrushObj = NULL;
GDIBRUSHINST PenBrushInst, FillBrushInst;
PBRUSH pbrushLine = NULL, pbrushFill = NULL;
EBRUSHOBJ eboLine, eboFill;
BOOL ret = FALSE; // default to failure
RECTL DestRect;
MIX Mix;
@ -579,9 +579,9 @@ IntRectangle(PDC dc,
IntGdiSelectPen(dc,pdcattr->hpen);
/* Special locking order to avoid lock-ups! */
FillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
if (!PenBrushObj)
pbrushFill = BRUSH_LockBrush(pdcattr->hbrush);
pbrushLine = PENOBJ_LockPen(pdcattr->hpen);
if (!pbrushLine)
{
ret = FALSE;
goto cleanup;
@ -593,14 +593,14 @@ IntRectangle(PDC dc,
goto cleanup;
}
if ( FillBrushObj )
if ( pbrushFill )
{
if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
if (!(pbrushFill->flAttrs & GDIBRUSH_IS_NULL))
{
BrushOrigin = *((PPOINTL)&FillBrushObj->ptOrigin);
BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin);
BrushOrigin.x += dc->ptlDCOrig.x;
BrushOrigin.y += dc->ptlDCOrig.y;
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->rosdc.XlateBrush);
IntGdiInitBrushInstance(&eboFill, pbrushFill, dc->rosdc.XlateBrush);
ret = IntEngBitBlt(&psurf->SurfObj,
NULL,
NULL,
@ -609,56 +609,56 @@ IntRectangle(PDC dc,
&DestRect,
NULL,
NULL,
&FillBrushInst.BrushObject,
&eboFill.BrushObject,
&BrushOrigin,
ROP3_TO_ROP4(PATCOPY));
}
}
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->rosdc.XlatePen);
IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen);
// Draw the rectangle with the current pen
ret = TRUE; // change default to success
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
if (!(pbrushLine->flAttrs & GDIBRUSH_IS_NULL))
{
Mix = ROP2_TO_MIX(pdcattr->jROP2);
ret = ret && IntEngLineTo(&psurf->SurfObj,
dc->rosdc.CombinedClip,
&PenBrushInst.BrushObject,
&eboLine.BrushObject,
DestRect.left, DestRect.top, DestRect.right, DestRect.top,
&DestRect, // Bounding rectangle
Mix);
ret = ret && IntEngLineTo(&psurf->SurfObj,
dc->rosdc.CombinedClip,
&PenBrushInst.BrushObject,
&eboLine.BrushObject,
DestRect.right, DestRect.top, DestRect.right, DestRect.bottom,
&DestRect, // Bounding rectangle
Mix);
ret = ret && IntEngLineTo(&psurf->SurfObj,
dc->rosdc.CombinedClip,
&PenBrushInst.BrushObject,
&eboLine.BrushObject,
DestRect.right, DestRect.bottom, DestRect.left, DestRect.bottom,
&DestRect, // Bounding rectangle
Mix);
ret = ret && IntEngLineTo(&psurf->SurfObj,
dc->rosdc.CombinedClip,
&PenBrushInst.BrushObject,
&eboLine.BrushObject,
DestRect.left, DestRect.bottom, DestRect.left, DestRect.top,
&DestRect, // Bounding rectangle
Mix);
}
cleanup:
if (FillBrushObj)
BRUSHOBJ_UnlockBrush(FillBrushObj);
if (pbrushFill)
BRUSH_UnlockBrush(pbrushFill);
if (PenBrushObj)
PENOBJ_UnlockPen(PenBrushObj);
if (pbrushLine)
PENOBJ_UnlockPen(pbrushLine);
if (psurf)
SURFACE_UnlockSurface(psurf);
@ -712,12 +712,11 @@ IntRoundRect(
int yCurveDiameter)
{
PDC_ATTR pdcattr;
PGDIBRUSHOBJ PenBrushObj;
PBRUSH pbrushLine, pbrushFill;
RECTL RectBounds;
LONG PenWidth, PenOrigWidth;
BOOL ret = TRUE; // default to success
PGDIBRUSHOBJ pFillBrushObj;
GDIBRUSHOBJ tmpFillBrushObj;
BRUSH brushTemp;
ASSERT ( dc ); // caller's responsibility to set this up
@ -747,18 +746,18 @@ IntRoundRect(
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
IntGdiSelectPen(dc,pdcattr->hpen);
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
if (!PenBrushObj)
pbrushLine = PENOBJ_LockPen(pdcattr->hpen);
if (!pbrushLine)
{
/* Nothing to do, as we don't have a bitmap */
SetLastWin32Error(ERROR_INTERNAL_ERROR);
return FALSE;
}
PenOrigWidth = PenWidth = PenBrushObj->ptPenWidth.x;
if (PenBrushObj->ulPenStyle == PS_NULL) PenWidth = 0;
PenOrigWidth = PenWidth = pbrushLine->ptPenWidth.x;
if (pbrushLine->ulPenStyle == PS_NULL) PenWidth = 0;
if (PenBrushObj->ulPenStyle == PS_INSIDEFRAME)
if (pbrushLine->ulPenStyle == PS_INSIDEFRAME)
{
if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2;
if (2*PenWidth > (Bottom - Top)) PenWidth = (Bottom -Top + 1)/2;
@ -769,7 +768,7 @@ IntRoundRect(
}
if (!PenWidth) PenWidth = 1;
PenBrushObj->ptPenWidth.x = PenWidth;
pbrushLine->ptPenWidth.x = PenWidth;
RectBounds.left = Left;
RectBounds.top = Top;
@ -783,8 +782,8 @@ IntRoundRect(
RectBounds.right += dc->ptlDCOrig.x;
RectBounds.bottom += dc->ptlDCOrig.y;
pFillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
if (NULL == pFillBrushObj)
pbrushFill = BRUSH_LockBrush(pdcattr->hbrush);
if (NULL == pbrushFill)
{
DPRINT1("FillRound Fail\n");
SetLastWin32Error(ERROR_INTERNAL_ERROR);
@ -792,9 +791,9 @@ IntRoundRect(
}
else
{
RtlCopyMemory(&tmpFillBrushObj, pFillBrushObj, sizeof(tmpFillBrushObj));
tmpFillBrushObj.ptOrigin.x += RectBounds.left - Left;
tmpFillBrushObj.ptOrigin.y += RectBounds.top - Top;
RtlCopyMemory(&brushTemp, pbrushFill, sizeof(brushTemp));
brushTemp.ptOrigin.x += RectBounds.left - Left;
brushTemp.ptOrigin.y += RectBounds.top - Top;
ret = IntFillRoundRect( dc,
RectBounds.left,
RectBounds.top,
@ -802,8 +801,8 @@ IntRoundRect(
RectBounds.bottom,
xCurveDiameter,
yCurveDiameter,
&tmpFillBrushObj);
BRUSHOBJ_UnlockBrush(pFillBrushObj);
&brushTemp);
BRUSH_UnlockBrush(pbrushFill);
}
if (ret)
@ -814,10 +813,10 @@ IntRoundRect(
RectBounds.bottom,
xCurveDiameter,
yCurveDiameter,
PenBrushObj);
pbrushLine);
PenBrushObj->ptPenWidth.x = PenOrigWidth;
PENOBJ_UnlockPen(PenBrushObj);
pbrushLine->ptPenWidth.x = PenOrigWidth;
PENOBJ_UnlockPen(pbrushLine);
return ret;
}
@ -1087,8 +1086,8 @@ NtGdiExtFloodFill(
PDC dc;
PDC_ATTR pdcattr;
SURFACE *psurf = NULL;
PGDIBRUSHOBJ FillBrushObj = NULL;
GDIBRUSHINST FillBrushInst;
PBRUSH pbrushFill = NULL;
EBRUSHOBJ eboFill;
BOOL Ret = FALSE;
RECTL DestRect;
POINTL Pt;
@ -1127,8 +1126,8 @@ NtGdiExtFloodFill(
else
goto cleanup;
FillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
if (!FillBrushObj)
pbrushFill = BRUSH_LockBrush(pdcattr->hbrush);
if (!pbrushFill)
{
Ret = FALSE;
goto cleanup;
@ -1140,19 +1139,19 @@ NtGdiExtFloodFill(
goto cleanup;
}
if ( FillBrushObj && (FillType == FLOODFILLBORDER))
if ( pbrushFill && (FillType == FLOODFILLBORDER))
{
if (!(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
if (!(pbrushFill->flAttrs & GDIBRUSH_IS_NULL))
{
FillBrushObj->BrushAttr.lbColor = Color;
BrushOrigin = *((PPOINTL)&FillBrushObj->ptOrigin);
pbrushFill->BrushAttr.lbColor = Color;
BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin);
BrushOrigin.x += dc->ptlDCOrig.x;
BrushOrigin.y += dc->ptlDCOrig.y;
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->rosdc.XlateBrush);
IntGdiInitBrushInstance(&eboFill, pbrushFill, dc->rosdc.XlateBrush);
Ret = IntEngBitBlt(&psurf->SurfObj, NULL, NULL,
dc->rosdc.CombinedClip, NULL,
&DestRect, NULL, NULL,
&FillBrushInst.BrushObject,
&eboFill.BrushObject,
&BrushOrigin,
ROP3_TO_ROP4(PATCOPY));
}
@ -1162,8 +1161,8 @@ NtGdiExtFloodFill(
}
cleanup:
if (FillBrushObj)
BRUSHOBJ_UnlockBrush(FillBrushObj);
if (pbrushFill)
BRUSH_UnlockBrush(pbrushFill);
if (psurf)
SURFACE_UnlockSurface(psurf);

View file

@ -3128,12 +3128,12 @@ GreExtTextOutW(
FT_Bool use_kerning;
RECTL DestRect, MaskRect;
POINTL SourcePoint, BrushOrigin;
HBRUSH hBrushFg = NULL;
PGDIBRUSHOBJ BrushFg = NULL;
GDIBRUSHINST BrushFgInst;
HBRUSH hBrushBg = NULL;
PGDIBRUSHOBJ BrushBg = NULL;
GDIBRUSHINST BrushBgInst;
HBRUSH hbrushText = NULL;
PBRUSH pbrushText = NULL;
EBRUSHOBJ eboText;
HBRUSH hbrushBackGnd = NULL;
PBRUSH pbrushBackGnd = NULL;
EBRUSHOBJ eboBackGnd;
HBITMAP HSourceGlyph;
SURFOBJ *SourceGlyphSurf;
SIZEL bitSize;
@ -3227,30 +3227,30 @@ GreExtTextOutW(
{
goto fail;
}
hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, pdcattr->crForegroundClr), 0);
if ( !hBrushFg )
hbrushText = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, pdcattr->crForegroundClr), 0);
if ( !hbrushText )
{
goto fail;
}
BrushFg = BRUSHOBJ_LockBrush(hBrushFg);
if ( !BrushFg )
pbrushText = BRUSH_LockBrush(hbrushText);
if ( !pbrushText )
{
goto fail;
}
IntGdiInitBrushInstance(&BrushFgInst, BrushFg, NULL);
IntGdiInitBrushInstance(&eboText, pbrushText, NULL);
if ((fuOptions & ETO_OPAQUE) || pdcattr->jBkMode == OPAQUE)
{
hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, pdcattr->crBackgroundClr), 0);
if ( !hBrushBg )
hbrushBackGnd = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, pdcattr->crBackgroundClr), 0);
if ( !hbrushBackGnd )
{
goto fail;
}
BrushBg = BRUSHOBJ_LockBrush(hBrushBg);
if ( !BrushBg )
pbrushBackGnd = BRUSH_LockBrush(hbrushBackGnd);
if ( !pbrushBackGnd )
{
goto fail;
}
IntGdiInitBrushInstance(&BrushBgInst, BrushBg, NULL);
IntGdiInitBrushInstance(&eboBackGnd, pbrushBackGnd, NULL);
}
XlateObj2 = (XLATEOBJ*)IntEngCreateXlate(PAL_RGB, Mode, NULL, hDestPalette);
if ( !XlateObj2 )
@ -3281,7 +3281,7 @@ GreExtTextOutW(
&DestRect,
&SourcePoint,
&SourcePoint,
&BrushBgInst.BrushObject,
&eboBackGnd.BrushObject,
&BrushOrigin,
ROP3_TO_ROP4(PATCOPY));
fuOptions &= ~ETO_OPAQUE;
@ -3527,7 +3527,7 @@ GreExtTextOutW(
&DestRect,
&SourcePoint,
&SourcePoint,
&BrushBgInst.BrushObject,
&eboBackGnd.BrushObject,
&BrushOrigin,
ROP3_TO_ROP4(PATCOPY));
BackgroundLeft = DestRect.right;
@ -3599,7 +3599,7 @@ GreExtTextOutW(
&DestRect,
&SourcePoint,
(PPOINTL)&MaskRect,
&BrushFgInst.BrushObject,
&eboText.BrushObject,
&BrushOrigin);
EngUnlockSurface(SourceGlyphSurf);
@ -3638,13 +3638,13 @@ GreExtTextOutW(
SURFACE_UnlockSurface(psurf);
if (TextObj != NULL)
TEXTOBJ_UnlockText(TextObj);
if (hBrushBg != NULL)
if (hbrushBackGnd != NULL)
{
BRUSHOBJ_UnlockBrush(BrushBg);
NtGdiDeleteObject(hBrushBg);
BRUSH_UnlockBrush(pbrushBackGnd);
NtGdiDeleteObject(hbrushBackGnd);
}
BRUSHOBJ_UnlockBrush(BrushFg);
NtGdiDeleteObject(hBrushFg);
BRUSH_UnlockBrush(pbrushText);
NtGdiDeleteObject(hbrushText);
good:
DC_UnlockDc( dc );
@ -3659,15 +3659,15 @@ fail:
TEXTOBJ_UnlockText(TextObj);
if (psurf != NULL)
SURFACE_UnlockSurface(psurf);
if (hBrushBg != NULL)
if (hbrushBackGnd != NULL)
{
BRUSHOBJ_UnlockBrush(BrushBg);
NtGdiDeleteObject(hBrushBg);
BRUSH_UnlockBrush(pbrushBackGnd);
NtGdiDeleteObject(hbrushBackGnd);
}
if (hBrushFg != NULL)
if (hbrushText != NULL)
{
BRUSHOBJ_UnlockBrush(BrushFg);
NtGdiDeleteObject(hBrushFg);
BRUSH_UnlockBrush(pbrushText);
NtGdiDeleteObject(hbrushText);
}
DC_UnlockDc(dc);

View file

@ -58,7 +58,7 @@ OBJ_TYPE_INFO ObjTypeInfo[BASE_OBJTYPE_COUNT] =
{0, 0, TAG_PFT, NULL}, /* 0d PFT, unused */
{0, sizeof(GDICLRXFORM), TAG_ICMCXF, GDI_CleanupDummy}, /* 0e ICMCXF, */
{0, 0, TAG_SPRITE, NULL}, /* 0f SPRITE, unused */
{1, sizeof(GDIBRUSHOBJ), TAG_BRUSH, BRUSH_Cleanup}, /* 10 BRUSH, PEN, EXTPEN */
{1, sizeof(BRUSH), TAG_BRUSH, BRUSH_Cleanup}, /* 10 BRUSH, PEN, EXTPEN */
{0, 0, TAG_UMPD, NULL}, /* 11 UMPD, unused */
{0, 0, 0, NULL}, /* 12 UNUSED4 */
{0, 0, TAG_SPACE, NULL}, /* 13 SPACE, unused */
@ -1455,7 +1455,7 @@ GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCESS Process)
Example Allocating:
// Save Kernel Space Pointer
(PGDIBRUSHOBJ)->pBrushAttr = IntGdiAllocObjAttr(GDIObjType_BRUSH_TYPE);
(PBRUSH)->pBrushAttr = IntGdiAllocObjAttr(GDIObjType_BRUSH_TYPE);
// Kernel Space to User Space Pointer
(PGDI_TABLE_ENTRY)->UserData = pBrushAttr;
@ -1464,8 +1464,8 @@ GDI_MapHandleTable(PSECTION_OBJECT SectionObject, PEPROCESS Process)
Example Freeing:
(PGDI_TABLE_ENTRY)->UserData = NULL; // Zero the user ptr.
UserHeapFree((PGDIBRUSHOBJ)->pBrushAttr); // Free from kernel ptr.
(PGDIBRUSHOBJ)->pBrushAttr = NULL;
UserHeapFree((PBRUSH)->pBrushAttr); // Free from kernel ptr.
(PBRUSH)->pBrushAttr = NULL;
Notes:
Testing with DC_ATTR works but has drawing difficulties.
@ -1502,7 +1502,7 @@ IntGdiAllocObjAttr(GDIOBJTYPE Type)
BOOL
FASTCALL
IntGdiSetBrushOwner(PGDIBRUSHOBJ pbr, DWORD OwnerMask)
IntGdiSetBrushOwner(PBRUSH pbr, DWORD OwnerMask)
{
HBRUSH hBR;
PEPROCESS Owner = NULL;
@ -1587,8 +1587,8 @@ IntGdiSetDCOwnerEx( HDC hDC, DWORD OwnerMask, BOOL NoSetBrush)
if ((OwnerMask != GDI_OBJ_HMGR_NONE) && !NoSetBrush)
{
pDC = DC_LockDc ( hDC );
if (IntGdiSetBrushOwner((PGDIBRUSHOBJ)pDC->dclevel.pbrFill, OwnerMask))
IntGdiSetBrushOwner((PGDIBRUSHOBJ)pDC->dclevel.pbrLine, OwnerMask);
if (IntGdiSetBrushOwner((PBRUSH)pDC->dclevel.pbrFill, OwnerMask))
IntGdiSetBrushOwner((PBRUSH)pDC->dclevel.pbrLine, OwnerMask);
DC_UnlockDc( pDC );
}
return TRUE;
@ -1664,11 +1664,11 @@ IntGdiGetObject(IN HANDLE Handle,
{
case GDI_OBJECT_TYPE_PEN:
case GDI_OBJECT_TYPE_EXTPEN:
Result = PEN_GetObject((PGDIBRUSHOBJ) pGdiObject, cbCount, (PLOGPEN) lpBuffer); // IntGdiCreatePenIndirect
Result = PEN_GetObject((PBRUSH) pGdiObject, cbCount, (PLOGPEN) lpBuffer); // IntGdiCreatePenIndirect
break;
case GDI_OBJECT_TYPE_BRUSH:
Result = BRUSH_GetObject((PGDIBRUSHOBJ ) pGdiObject, cbCount, (LPLOGBRUSH)lpBuffer);
Result = BRUSH_GetObject((PBRUSH ) pGdiObject, cbCount, (LPLOGBRUSH)lpBuffer);
break;
case GDI_OBJECT_TYPE_BITMAP:

View file

@ -89,8 +89,8 @@ IntGdiLineTo(DC *dc,
{
SURFACE *psurf;
BOOL Ret = TRUE;
PGDIBRUSHOBJ PenBrushObj;
GDIBRUSHINST PenBrushInst;
PBRUSH pbrushLine;
EBRUSHOBJ eboLine;
RECTL Bounds;
POINT Points[2];
PDC_ATTR pdcattr = dc->pdcattr;
@ -143,21 +143,21 @@ IntGdiLineTo(DC *dc,
Bounds.right = max(Points[0].x, Points[1].x);
Bounds.bottom = max(Points[0].y, Points[1].y);
/* get BRUSHOBJ from current pen. */
PenBrushObj = PENOBJ_LockPen( pdcattr->hpen );
if (!PenBrushObj)
/* get BRUSH from current pen. */
pbrushLine = PENOBJ_LockPen( pdcattr->hpen );
if (!pbrushLine)
{
/* default to BLACK_PEN */
PenBrushObj = PENOBJ_LockPen(NtGdiGetStockObject(BLACK_PEN));
ASSERT(PenBrushObj);
pbrushLine = PENOBJ_LockPen(NtGdiGetStockObject(BLACK_PEN));
ASSERT(pbrushLine);
}
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
if (!(pbrushLine->flAttrs & GDIBRUSH_IS_NULL))
{
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->rosdc.XlatePen);
IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen);
Ret = IntEngLineTo(&psurf->SurfObj,
dc->rosdc.CombinedClip,
&PenBrushInst.BrushObject,
&eboLine.BrushObject,
Points[0].x, Points[0].y,
Points[1].x, Points[1].y,
&Bounds,
@ -165,7 +165,7 @@ IntGdiLineTo(DC *dc,
}
SURFACE_UnlockSurface(psurf);
PENOBJ_UnlockPen( PenBrushObj );
PENOBJ_UnlockPen( pbrushLine );
}
if (Ret)
@ -251,8 +251,8 @@ IntGdiPolyline(DC *dc,
int Count)
{
SURFACE *psurf;
GDIBRUSHOBJ *PenBrushObj;
GDIBRUSHINST PenBrushInst;
BRUSH *pbrushLine;
EBRUSHOBJ eboLine;
LPPOINT Points;
BOOL Ret = TRUE;
LONG i;
@ -268,11 +268,11 @@ IntGdiPolyline(DC *dc,
IntGdiSelectPen(dc,pdcattr->hpen);
/* Get BRUSHOBJ from current pen. */
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
/* FIXME - PenBrushObj can be NULL! Don't assert here! */
ASSERT(PenBrushObj);
pbrushLine = PENOBJ_LockPen(pdcattr->hpen);
/* FIXME - pbrushLine can be NULL! Don't assert here! */
ASSERT(pbrushLine);
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
if (!(pbrushLine->flAttrs & GDIBRUSH_IS_NULL))
{
Points = EngAllocMem(0, Count * sizeof(POINT), TAG_COORD);
if (Points != NULL)
@ -292,10 +292,10 @@ IntGdiPolyline(DC *dc,
Points[i].y += dc->ptlDCOrig.y;
}
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->rosdc.XlatePen);
IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen);
Ret = IntEngPolyline(&psurf->SurfObj,
dc->rosdc.CombinedClip,
&PenBrushInst.BrushObject,
&eboLine.BrushObject,
Points,
Count,
ROP2_TO_MIX(pdcattr->jROP2));
@ -309,7 +309,7 @@ IntGdiPolyline(DC *dc,
}
}
PENOBJ_UnlockPen(PenBrushObj);
PENOBJ_UnlockPen(pbrushLine);
return Ret;
}

View file

@ -27,7 +27,7 @@
/* PRIVATE FUNCTIONS **********************************************************/
PGDIBRUSHOBJ
PBRUSH
FASTCALL
PENOBJ_LockPen(HGDIOBJ hBMObj)
{
@ -52,7 +52,7 @@ IntGdiExtCreatePen(
IN OPTIONAL HBRUSH hbrush)
{
HPEN hPen;
PGDIBRUSHOBJ PenObject;
PBRUSH pbrushPen;
static const BYTE PatternAlternate[] = {0x55, 0x55, 0x55};
static const BYTE PatternDash[] = {0xFF, 0xFF, 0xC0};
static const BYTE PatternDot[] = {0xE3, 0x8E, 0x38};
@ -68,36 +68,36 @@ IntGdiExtCreatePen(
if (bOldStylePen)
{
PenObject = PENOBJ_AllocPenWithHandle();
pbrushPen = PENOBJ_AllocPenWithHandle();
}
else
{
PenObject = PENOBJ_AllocExtPenWithHandle();
pbrushPen = PENOBJ_AllocExtPenWithHandle();
}
if (!PenObject)
if (!pbrushPen)
{
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
DPRINT("Can't allocate pen\n");
return 0;
}
hPen = PenObject->BaseObject.hHmgr;
hPen = pbrushPen->BaseObject.hHmgr;
// If nWidth is zero, the pen is a single pixel wide, regardless of the current transformation.
if ((bOldStylePen) && (!dwWidth) && (dwPenStyle & PS_STYLE_MASK) != PS_SOLID)
dwWidth = 1;
PenObject->ptPenWidth.x = dwWidth;
PenObject->ptPenWidth.y = 0;
PenObject->ulPenStyle = dwPenStyle;
PenObject->BrushAttr.lbColor = ulColor;
PenObject->ulStyle = ulBrushStyle;
pbrushPen->ptPenWidth.x = dwWidth;
pbrushPen->ptPenWidth.y = 0;
pbrushPen->ulPenStyle = dwPenStyle;
pbrushPen->BrushAttr.lbColor = ulColor;
pbrushPen->ulStyle = ulBrushStyle;
// FIXME: copy the bitmap first ?
PenObject->hbmClient = (HANDLE)ulClientHatch;
PenObject->dwStyleCount = dwStyleCount;
PenObject->pStyle = pStyle;
pbrushPen->hbmClient = (HANDLE)ulClientHatch;
pbrushPen->dwStyleCount = dwStyleCount;
pbrushPen->pStyle = pStyle;
PenObject->flAttrs = bOldStylePen? GDIBRUSH_IS_OLDSTYLEPEN : GDIBRUSH_IS_PEN;
pbrushPen->flAttrs = bOldStylePen? GDIBRUSH_IS_OLDSTYLEPEN : GDIBRUSH_IS_PEN;
// If dwPenStyle is PS_COSMETIC, the width must be set to 1.
if ( !(bOldStylePen) && ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) && ( dwWidth != 1) )
@ -106,40 +106,40 @@ IntGdiExtCreatePen(
switch (dwPenStyle & PS_STYLE_MASK)
{
case PS_NULL:
PenObject->flAttrs |= GDIBRUSH_IS_NULL;
pbrushPen->flAttrs |= GDIBRUSH_IS_NULL;
break;
case PS_SOLID:
PenObject->flAttrs |= GDIBRUSH_IS_SOLID;
pbrushPen->flAttrs |= GDIBRUSH_IS_SOLID;
break;
case PS_ALTERNATE:
PenObject->flAttrs |= GDIBRUSH_IS_BITMAP;
PenObject->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternAlternate);
pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP;
pbrushPen->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternAlternate);
break;
case PS_DOT:
PenObject->flAttrs |= GDIBRUSH_IS_BITMAP;
PenObject->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDot);
pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP;
pbrushPen->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDot);
break;
case PS_DASH:
PenObject->flAttrs |= GDIBRUSH_IS_BITMAP;
PenObject->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDash);
pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP;
pbrushPen->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDash);
break;
case PS_DASHDOT:
PenObject->flAttrs |= GDIBRUSH_IS_BITMAP;
PenObject->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDot);
pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP;
pbrushPen->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDot);
break;
case PS_DASHDOTDOT:
PenObject->flAttrs |= GDIBRUSH_IS_BITMAP;
PenObject->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDotDot);
pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP;
pbrushPen->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDotDot);
break;
case PS_INSIDEFRAME:
PenObject->flAttrs |= (GDIBRUSH_IS_SOLID|GDIBRUSH_IS_INSIDEFRAME);
pbrushPen->flAttrs |= (GDIBRUSH_IS_SOLID|GDIBRUSH_IS_INSIDEFRAME);
break;
case PS_USERSTYLE:
@ -147,7 +147,7 @@ IntGdiExtCreatePen(
{
/* FIXME: PS_USERSTYLE workaround */
DPRINT1("PS_COSMETIC | PS_USERSTYLE not handled\n");
PenObject->flAttrs |= GDIBRUSH_IS_SOLID;
pbrushPen->flAttrs |= GDIBRUSH_IS_SOLID;
break;
}
else
@ -167,19 +167,19 @@ IntGdiExtCreatePen(
}
}
/* FIXME: what style here? */
PenObject->flAttrs |= 0;
pbrushPen->flAttrs |= 0;
break;
default:
DPRINT1("IntGdiExtCreatePen unknown penstyle %x\n", dwPenStyle);
}
PENOBJ_UnlockPen(PenObject);
PENOBJ_UnlockPen(pbrushPen);
return hPen;
ExitCleanup:
SetLastWin32Error(ERROR_INVALID_PARAMETER);
PenObject->pStyle = NULL;
PENOBJ_UnlockPen(PenObject);
pbrushPen->pStyle = NULL;
PENOBJ_UnlockPen(pbrushPen);
if (bOldStylePen)
PENOBJ_FreePenByHandle(hPen);
else
@ -190,27 +190,27 @@ ExitCleanup:
VOID FASTCALL
IntGdiSetSolidPenColor(HPEN hPen, COLORREF Color)
{
PGDIBRUSHOBJ PenObject;
PBRUSH pbrushPen;
PenObject = PENOBJ_LockPen(hPen);
if (PenObject)
pbrushPen = PENOBJ_LockPen(hPen);
if (pbrushPen)
{
if (PenObject->flAttrs & GDIBRUSH_IS_SOLID)
if (pbrushPen->flAttrs & GDIBRUSH_IS_SOLID)
{
PenObject->BrushAttr.lbColor = Color & 0xFFFFFF;
pbrushPen->BrushAttr.lbColor = Color & 0xFFFFFF;
}
PENOBJ_UnlockPen(PenObject);
PENOBJ_UnlockPen(pbrushPen);
}
}
INT APIENTRY
PEN_GetObject(PGDIBRUSHOBJ pPenObject, INT cbCount, PLOGPEN pBuffer)
PEN_GetObject(PBRUSH pbrushPen, INT cbCount, PLOGPEN pBuffer)
{
PLOGPEN pLogPen;
PEXTLOGPEN pExtLogPen;
INT cbRetCount;
if (pPenObject->flAttrs & GDIBRUSH_IS_OLDSTYLEPEN)
if (pbrushPen->flAttrs & GDIBRUSH_IS_OLDSTYLEPEN)
{
cbRetCount = sizeof(LOGPEN);
if (pBuffer)
@ -218,14 +218,14 @@ PEN_GetObject(PGDIBRUSHOBJ pPenObject, INT cbCount, PLOGPEN pBuffer)
if (cbCount < cbRetCount) return 0;
if ( (pPenObject->ulPenStyle & PS_STYLE_MASK) == PS_NULL &&
if ( (pbrushPen->ulPenStyle & PS_STYLE_MASK) == PS_NULL &&
cbCount == sizeof(EXTLOGPEN))
{
pExtLogPen = (PEXTLOGPEN)pBuffer;
pExtLogPen->elpPenStyle = pPenObject->ulPenStyle;
pExtLogPen->elpPenStyle = pbrushPen->ulPenStyle;
pExtLogPen->elpWidth = 0;
pExtLogPen->elpBrushStyle = pPenObject->ulStyle;
pExtLogPen->elpColor = pPenObject->BrushAttr.lbColor;
pExtLogPen->elpBrushStyle = pbrushPen->ulStyle;
pExtLogPen->elpColor = pbrushPen->BrushAttr.lbColor;
pExtLogPen->elpHatch = 0;
pExtLogPen->elpNumEntries = 0;
cbRetCount = sizeof(EXTLOGPEN);
@ -233,31 +233,31 @@ PEN_GetObject(PGDIBRUSHOBJ pPenObject, INT cbCount, PLOGPEN pBuffer)
else
{
pLogPen = (PLOGPEN)pBuffer;
pLogPen->lopnWidth = pPenObject->ptPenWidth;
pLogPen->lopnStyle = pPenObject->ulPenStyle;
pLogPen->lopnColor = pPenObject->BrushAttr.lbColor;
pLogPen->lopnWidth = pbrushPen->ptPenWidth;
pLogPen->lopnStyle = pbrushPen->ulPenStyle;
pLogPen->lopnColor = pbrushPen->BrushAttr.lbColor;
}
}
}
else
{
// FIXME: Can we trust in dwStyleCount being <= 16?
cbRetCount = sizeof(EXTLOGPEN) - sizeof(DWORD) + pPenObject->dwStyleCount * sizeof(DWORD);
cbRetCount = sizeof(EXTLOGPEN) - sizeof(DWORD) + pbrushPen->dwStyleCount * sizeof(DWORD);
if (pBuffer)
{
INT i;
if (cbCount < cbRetCount) return 0;
pExtLogPen = (PEXTLOGPEN)pBuffer;
pExtLogPen->elpPenStyle = pPenObject->ulPenStyle;
pExtLogPen->elpWidth = pPenObject->ptPenWidth.x;
pExtLogPen->elpBrushStyle = pPenObject->ulStyle;
pExtLogPen->elpColor = pPenObject->BrushAttr.lbColor;
pExtLogPen->elpHatch = (ULONG_PTR)pPenObject->hbmClient;
pExtLogPen->elpNumEntries = pPenObject->dwStyleCount;
pExtLogPen->elpPenStyle = pbrushPen->ulPenStyle;
pExtLogPen->elpWidth = pbrushPen->ptPenWidth.x;
pExtLogPen->elpBrushStyle = pbrushPen->ulStyle;
pExtLogPen->elpColor = pbrushPen->BrushAttr.lbColor;
pExtLogPen->elpHatch = (ULONG_PTR)pbrushPen->hbmClient;
pExtLogPen->elpNumEntries = pbrushPen->dwStyleCount;
for (i = 0; i < pExtLogPen->elpNumEntries; i++)
{
pExtLogPen->elpStyleEntry[i] = pPenObject->pStyle[i];
pExtLogPen->elpStyleEntry[i] = pbrushPen->pStyle[i];
}
}
}
@ -274,7 +274,7 @@ IntGdiSelectPen(
{
PDC_ATTR pdcattr;
HPEN hOrgPen = NULL;
PGDIBRUSHOBJ pPen;
PBRUSH pbrushPen;
XLATEOBJ *XlateObj;
BOOLEAN bFailed;
@ -282,14 +282,14 @@ IntGdiSelectPen(
pdcattr = pDC->pdcattr;
pPen = PENOBJ_LockPen(hPen);
if (pPen == NULL)
pbrushPen = PENOBJ_LockPen(hPen);
if (pbrushPen == NULL)
{
return NULL;
}
XlateObj = IntGdiCreateBrushXlate(pDC, pPen, &bFailed);
PENOBJ_UnlockPen(pPen);
XlateObj = IntGdiCreateBrushXlate(pDC, pbrushPen, &bFailed);
PENOBJ_UnlockPen(pbrushPen);
if (bFailed)
{
SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES);

View file

@ -2903,8 +2903,8 @@ IntGdiPaintRgn(
PROSRGNDATA visrgn;
CLIPOBJ* ClipRegion;
BOOL bRet = FALSE;
PGDIBRUSHOBJ pBrush;
GDIBRUSHINST BrushInst;
PBRUSH pbrush;
EBRUSHOBJ eboFill;
POINTL BrushOrigin;
SURFACE *psurf;
PDC_ATTR pdcattr;
@ -2935,9 +2935,9 @@ IntGdiPaintRgn(
visrgn->Buffer,
&visrgn->rdh.rcBound );
ASSERT(ClipRegion);
pBrush = BRUSHOBJ_LockBrush(pdcattr->hbrush);
ASSERT(pBrush);
IntGdiInitBrushInstance(&BrushInst, pBrush, dc->rosdc.XlateBrush);
pbrush = BRUSH_LockBrush(pdcattr->hbrush);
ASSERT(pbrush);
IntGdiInitBrushInstance(&eboFill, pbrush, dc->rosdc.XlateBrush);
BrushOrigin.x = pdcattr->ptlBrushOrigin.x;
BrushOrigin.y = pdcattr->ptlBrushOrigin.y;
@ -2946,12 +2946,12 @@ IntGdiPaintRgn(
bRet = IntEngPaint(&psurf->SurfObj,
ClipRegion,
&BrushInst.BrushObject,
&eboFill.BrushObject,
&BrushOrigin,
0xFFFF);//FIXME:don't know what to put here
SURFACE_UnlockSurface(psurf);
BRUSHOBJ_UnlockBrush(pBrush);
BRUSH_UnlockBrush(pbrush);
REGION_UnlockRgn(visrgn);
NtGdiDeleteObject(tmpVisRgn);

View file

@ -118,32 +118,32 @@ IntCreateStockPen( DWORD dwPenStyle,
ULONG ulColor)
{
HPEN hPen;
PGDIBRUSHOBJ PenObject = PENOBJ_AllocPenWithHandle();
PBRUSH pbrushPen = PENOBJ_AllocPenWithHandle();
if ((dwPenStyle & PS_STYLE_MASK) == PS_NULL) dwWidth = 1;
PenObject->ptPenWidth.x = abs(dwWidth);
PenObject->ptPenWidth.y = 0;
PenObject->ulPenStyle = dwPenStyle;
PenObject->BrushAttr.lbColor = ulColor;
PenObject->ulStyle = ulBrushStyle;
PenObject->hbmClient = (HANDLE)NULL;
PenObject->dwStyleCount = 0;
PenObject->pStyle = 0;
PenObject->flAttrs = GDIBRUSH_IS_OLDSTYLEPEN;
pbrushPen->ptPenWidth.x = abs(dwWidth);
pbrushPen->ptPenWidth.y = 0;
pbrushPen->ulPenStyle = dwPenStyle;
pbrushPen->BrushAttr.lbColor = ulColor;
pbrushPen->ulStyle = ulBrushStyle;
pbrushPen->hbmClient = (HANDLE)NULL;
pbrushPen->dwStyleCount = 0;
pbrushPen->pStyle = 0;
pbrushPen->flAttrs = GDIBRUSH_IS_OLDSTYLEPEN;
switch (dwPenStyle & PS_STYLE_MASK)
{
case PS_NULL:
PenObject->flAttrs |= GDIBRUSH_IS_NULL;
pbrushPen->flAttrs |= GDIBRUSH_IS_NULL;
break;
case PS_SOLID:
PenObject->flAttrs |= GDIBRUSH_IS_SOLID;
pbrushPen->flAttrs |= GDIBRUSH_IS_SOLID;
break;
}
hPen = PenObject->BaseObject.hHmgr;
PENOBJ_UnlockPen(PenObject);
hPen = pbrushPen->BaseObject.hHmgr;
PENOBJ_UnlockPen(pbrushPen);
return hPen;
}
@ -232,11 +232,11 @@ IntSetSysColors(UINT nColors, INT *Elements, COLORREF *Colors)
}
BOOL FASTCALL
IntGetSysColorBrushes(HBRUSH *Brushes, UINT nBrushes)
IntGetSysColorBrushes(HBRUSH *pahBrushes, UINT nBrushes)
{
UINT i;
ASSERT(Brushes);
ASSERT(pahBrushes);
if(nBrushes > NUM_SYSCOLORS)
{
@ -246,7 +246,7 @@ IntGetSysColorBrushes(HBRUSH *Brushes, UINT nBrushes)
for(i = 0; i < nBrushes; i++)
{
*(Brushes++) = gpsi->SysColorBrushes[i];
pahBrushes[i] = gpsi->SysColorBrushes[i];
}
return nBrushes > 0;