Rename IntGdiInitBrushInstance to EBRUSHOBJ_vInit and move it to engbrush.c. Add 2 FIXME comments.

svn path=/trunk/; revision=40145
This commit is contained in:
Timo Kreuzer 2009-03-20 23:40:59 +00:00
parent 38dec447a2
commit 946deefb20
10 changed files with 50 additions and 64 deletions

View file

@ -1,27 +1,8 @@
/* /*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* PURPOSE: GDI Driver Brush Functions * PURPOSE: GDI Driver Brush Functions
* FILE: subsys/win32k/eng/brush.c * FILE: subsystem/win32/win32k/eng/engbrush.c
* PROGRAMER: Jason Filby * PROGRAMER: Jason Filby
* REVISION HISTORY: * REVISION HISTORY:
* 3/7/1999: Created * 3/7/1999: Created
@ -32,6 +13,37 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
/** Internal functions ********************************************************/
VOID FASTCALL
EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, XLATEOBJ *pxlo)
{
ASSERT(pebo);
ASSERT(pbrush);
if (pbrush->flAttrs & GDIBRUSH_IS_NULL)
{
pebo->BrushObject.iSolidColor = 0;
}
else if (pbrush->flAttrs & GDIBRUSH_IS_SOLID)
{
pebo->BrushObject.iSolidColor = XLATEOBJ_iXlate(pxlo, pbrush->BrushAttr.lbColor);
}
else
{
pebo->BrushObject.iSolidColor = 0xFFFFFFFF;
// FIXME: What about calling DrvRealizeBrush?
}
pebo->BrushObject.pvRbrush = pbrush->ulRealization;
pebo->BrushObject.flColorType = 0;
pebo->GdiBrushObject = pbrush;
pebo->XlateObject = pxlo;
}
/** Exported DDI functions ****************************************************/
/* /*
* @implemented * @implemented
*/ */
@ -49,6 +61,7 @@ BRUSHOBJ_pvAllocRbrush(IN BRUSHOBJ *BrushObj,
PVOID APIENTRY PVOID APIENTRY
BRUSHOBJ_pvGetRbrush(IN BRUSHOBJ *BrushObj) BRUSHOBJ_pvGetRbrush(IN BRUSHOBJ *BrushObj)
{ {
// FIXME: this is wrong! Read msdn.
return(BrushObj->pvRbrush); return(BrushObj->pvRbrush);
} }

View file

@ -15,9 +15,6 @@ XLATEOBJ*
FASTCALL FASTCALL
IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, SURFACE* pDestSurf, SURFACE* pSrcSurf); IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, SURFACE* pDestSurf, SURFACE* pSrcSurf);
VOID FASTCALL
IntGdiInitBrushInstance(EBRUSHOBJ *BrushInst, PBRUSH BrushObj, XLATEOBJ *XlateObj);
HBRUSH APIENTRY HBRUSH APIENTRY
IntGdiCreateDIBBrush( IntGdiCreateDIBBrush(
CONST BITMAPINFO *BitmapInfo, CONST BITMAPINFO *BitmapInfo,

View file

@ -166,7 +166,7 @@ IntArc( DC *dc,
return FALSE; return FALSE;
} }
IntGdiInitBrushInstance(&eboPen, pbrushPen, dc->rosdc.XlatePen); EBRUSHOBJ_vInit(&eboPen, pbrushPen, dc->rosdc.XlatePen);
if (arctype == GdiTypePie) if (arctype == GdiTypePie)
{ {

View file

@ -292,7 +292,7 @@ NtGdiBitBlt(
goto cleanup; goto cleanup;
} }
BrushOrigin = *((PPOINTL)&pbrush->ptOrigin); BrushOrigin = *((PPOINTL)&pbrush->ptOrigin);
IntGdiInitBrushInstance(&BrushInst, pbrush, DCDest->rosdc.XlateBrush); EBRUSHOBJ_vInit(&BrushInst, pbrush, DCDest->rosdc.XlateBrush);
} }
/* Create the XLATEOBJ. */ /* Create the XLATEOBJ. */
@ -874,7 +874,7 @@ NtGdiStretchBlt(
goto failed; goto failed;
} }
BrushOrigin = *((PPOINTL)&pbrush->ptOrigin); BrushOrigin = *((PPOINTL)&pbrush->ptOrigin);
IntGdiInitBrushInstance(&BrushInst, pbrush, DCDest->rosdc.XlateBrush); EBRUSHOBJ_vInit(&BrushInst, pbrush, DCDest->rosdc.XlateBrush);
} }
/* Offset the brush */ /* Offset the brush */
@ -968,7 +968,7 @@ IntPatBlt(
BrushOrigin.x = BrushObj->ptOrigin.x + dc->ptlDCOrig.x; BrushOrigin.x = BrushObj->ptOrigin.x + dc->ptlDCOrig.x;
BrushOrigin.y = BrushObj->ptOrigin.y + dc->ptlDCOrig.y; BrushOrigin.y = BrushObj->ptOrigin.y + dc->ptlDCOrig.y;
IntGdiInitBrushInstance(&eboFill, BrushObj, dc->rosdc.XlateBrush); EBRUSHOBJ_vInit(&eboFill, BrushObj, dc->rosdc.XlateBrush);
ret = IntEngBitBlt( ret = IntEngBitBlt(
&psurf->SurfObj, &psurf->SurfObj,

View file

@ -166,30 +166,6 @@ IntGdiCreateBrushXlate(PDC Dc, BRUSH *pbrush, BOOLEAN *Failed)
return Result; return Result;
} }
VOID FASTCALL
IntGdiInitBrushInstance(EBRUSHOBJ *BrushInst, PBRUSH pbrush, XLATEOBJ *XlateObj)
{
ASSERT(BrushInst);
ASSERT(pbrush);
if (pbrush->flAttrs & GDIBRUSH_IS_NULL)
{
BrushInst->BrushObject.iSolidColor = 0;
}
else if (pbrush->flAttrs & GDIBRUSH_IS_SOLID)
{
BrushInst->BrushObject.iSolidColor = XLATEOBJ_iXlate(XlateObj, pbrush->BrushAttr.lbColor);
}
else
{
BrushInst->BrushObject.iSolidColor = 0xFFFFFFFF;
}
BrushInst->BrushObject.pvRbrush = pbrush->ulRealization;
BrushInst->BrushObject.flColorType = 0;
BrushInst->GdiBrushObject = pbrush;
BrushInst->XlateObject = XlateObj;
}
/** /**
* @name CalculateColorTableSize * @name CalculateColorTableSize
* *

View file

@ -1237,9 +1237,9 @@ IntFillRect( DC *dc,
ROP = PATCOPY; ROP = PATCOPY;
if (Pen) if (Pen)
IntGdiInitBrushInstance(&eboFill, pbrush, dc->rosdc.XlatePen); EBRUSHOBJ_vInit(&eboFill, pbrush, dc->rosdc.XlatePen);
else else
IntGdiInitBrushInstance(&eboFill, pbrush, dc->rosdc.XlateBrush); EBRUSHOBJ_vInit(&eboFill, pbrush, dc->rosdc.XlateBrush);
Ret = IntEngBitBlt( Ret = IntEngBitBlt(
&psurf->SurfObj, &psurf->SurfObj,

View file

@ -107,7 +107,7 @@ IntGdiPolygon(PDC dc,
BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin); BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin);
BrushOrigin.x += dc->ptlDCOrig.x; BrushOrigin.x += dc->ptlDCOrig.x;
BrushOrigin.y += dc->ptlDCOrig.y; BrushOrigin.y += dc->ptlDCOrig.y;
IntGdiInitBrushInstance(&eboFill, pbrushFill, dc->rosdc.XlateBrush); EBRUSHOBJ_vInit(&eboFill, pbrushFill, dc->rosdc.XlateBrush);
ret = IntFillPolygon (dc, psurf, &eboFill.BrushObject, Points, Count, ret = IntFillPolygon (dc, psurf, &eboFill.BrushObject, Points, Count,
DestRect, &BrushOrigin); DestRect, &BrushOrigin);
} }
@ -119,7 +119,7 @@ IntGdiPolygon(PDC dc,
{ {
int i; int i;
IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen); EBRUSHOBJ_vInit(&eboLine, pbrushLine, dc->rosdc.XlatePen);
for (i = 0; i < Count-1; i++) for (i = 0; i < Count-1; i++)
{ {
@ -600,7 +600,7 @@ IntRectangle(PDC dc,
BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin); BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin);
BrushOrigin.x += dc->ptlDCOrig.x; BrushOrigin.x += dc->ptlDCOrig.x;
BrushOrigin.y += dc->ptlDCOrig.y; BrushOrigin.y += dc->ptlDCOrig.y;
IntGdiInitBrushInstance(&eboFill, pbrushFill, dc->rosdc.XlateBrush); EBRUSHOBJ_vInit(&eboFill, pbrushFill, dc->rosdc.XlateBrush);
ret = IntEngBitBlt(&psurf->SurfObj, ret = IntEngBitBlt(&psurf->SurfObj,
NULL, NULL,
NULL, NULL,
@ -615,7 +615,7 @@ IntRectangle(PDC dc,
} }
} }
IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen); EBRUSHOBJ_vInit(&eboLine, pbrushLine, dc->rosdc.XlatePen);
// Draw the rectangle with the current pen // Draw the rectangle with the current pen
@ -1147,7 +1147,7 @@ NtGdiExtFloodFill(
BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin); BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin);
BrushOrigin.x += dc->ptlDCOrig.x; BrushOrigin.x += dc->ptlDCOrig.x;
BrushOrigin.y += dc->ptlDCOrig.y; BrushOrigin.y += dc->ptlDCOrig.y;
IntGdiInitBrushInstance(&eboFill, pbrushFill, dc->rosdc.XlateBrush); EBRUSHOBJ_vInit(&eboFill, pbrushFill, dc->rosdc.XlateBrush);
Ret = IntEngBitBlt(&psurf->SurfObj, NULL, NULL, Ret = IntEngBitBlt(&psurf->SurfObj, NULL, NULL,
dc->rosdc.CombinedClip, NULL, dc->rosdc.CombinedClip, NULL,
&DestRect, NULL, NULL, &DestRect, NULL, NULL,

View file

@ -3237,7 +3237,7 @@ GreExtTextOutW(
{ {
goto fail; goto fail;
} }
IntGdiInitBrushInstance(&eboText, pbrushText, NULL); EBRUSHOBJ_vInit(&eboText, pbrushText, NULL);
if ((fuOptions & ETO_OPAQUE) || pdcattr->jBkMode == OPAQUE) if ((fuOptions & ETO_OPAQUE) || pdcattr->jBkMode == OPAQUE)
{ {
hbrushBackGnd = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, pdcattr->crBackgroundClr), 0); hbrushBackGnd = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, pdcattr->crBackgroundClr), 0);
@ -3250,7 +3250,7 @@ GreExtTextOutW(
{ {
goto fail; goto fail;
} }
IntGdiInitBrushInstance(&eboBackGnd, pbrushBackGnd, NULL); EBRUSHOBJ_vInit(&eboBackGnd, pbrushBackGnd, NULL);
} }
XlateObj2 = (XLATEOBJ*)IntEngCreateXlate(PAL_RGB, Mode, NULL, hDestPalette); XlateObj2 = (XLATEOBJ*)IntEngCreateXlate(PAL_RGB, Mode, NULL, hDestPalette);
if ( !XlateObj2 ) if ( !XlateObj2 )

View file

@ -154,7 +154,7 @@ IntGdiLineTo(DC *dc,
if (!(pbrushLine->flAttrs & GDIBRUSH_IS_NULL)) if (!(pbrushLine->flAttrs & GDIBRUSH_IS_NULL))
{ {
IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen); EBRUSHOBJ_vInit(&eboLine, pbrushLine, dc->rosdc.XlatePen);
Ret = IntEngLineTo(&psurf->SurfObj, Ret = IntEngLineTo(&psurf->SurfObj,
dc->rosdc.CombinedClip, dc->rosdc.CombinedClip,
&eboLine.BrushObject, &eboLine.BrushObject,
@ -292,7 +292,7 @@ IntGdiPolyline(DC *dc,
Points[i].y += dc->ptlDCOrig.y; Points[i].y += dc->ptlDCOrig.y;
} }
IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen); EBRUSHOBJ_vInit(&eboLine, pbrushLine, dc->rosdc.XlatePen);
Ret = IntEngPolyline(&psurf->SurfObj, Ret = IntEngPolyline(&psurf->SurfObj,
dc->rosdc.CombinedClip, dc->rosdc.CombinedClip,
&eboLine.BrushObject, &eboLine.BrushObject,

View file

@ -2937,7 +2937,7 @@ IntGdiPaintRgn(
ASSERT(ClipRegion); ASSERT(ClipRegion);
pbrush = BRUSH_LockBrush(pdcattr->hbrush); pbrush = BRUSH_LockBrush(pdcattr->hbrush);
ASSERT(pbrush); ASSERT(pbrush);
IntGdiInitBrushInstance(&eboFill, pbrush, dc->rosdc.XlateBrush); EBRUSHOBJ_vInit(&eboFill, pbrush, dc->rosdc.XlateBrush);
BrushOrigin.x = pdcattr->ptlBrushOrigin.x; BrushOrigin.x = pdcattr->ptlBrushOrigin.x;
BrushOrigin.y = pdcattr->ptlBrushOrigin.y; BrushOrigin.y = pdcattr->ptlBrushOrigin.y;