From 946deefb202692a168e245be7ac989675728dabe Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 20 Mar 2009 23:40:59 +0000 Subject: [PATCH] Rename IntGdiInitBrushInstance to EBRUSHOBJ_vInit and move it to engbrush.c. Add 2 FIXME comments. svn path=/trunk/; revision=40145 --- .../subsystems/win32/win32k/eng/engbrush.c | 55 ++++++++++++------- .../subsystems/win32/win32k/include/intgdi.h | 3 - reactos/subsystems/win32/win32k/objects/arc.c | 2 +- .../subsystems/win32/win32k/objects/bitblt.c | 6 +- .../subsystems/win32/win32k/objects/brush.c | 24 -------- .../subsystems/win32/win32k/objects/drawing.c | 4 +- .../win32/win32k/objects/fillshap.c | 10 ++-- .../win32/win32k/objects/freetype.c | 4 +- .../subsystems/win32/win32k/objects/line.c | 4 +- .../subsystems/win32/win32k/objects/region.c | 2 +- 10 files changed, 50 insertions(+), 64 deletions(-) diff --git a/reactos/subsystems/win32/win32k/eng/engbrush.c b/reactos/subsystems/win32/win32k/eng/engbrush.c index 686732acf1e..259703fa771 100644 --- a/reactos/subsystems/win32/win32k/eng/engbrush.c +++ b/reactos/subsystems/win32/win32k/eng/engbrush.c @@ -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 * PROJECT: ReactOS kernel * PURPOSE: GDI Driver Brush Functions - * FILE: subsys/win32k/eng/brush.c + * FILE: subsystem/win32/win32k/eng/engbrush.c * PROGRAMER: Jason Filby * REVISION HISTORY: * 3/7/1999: Created @@ -32,6 +13,37 @@ #define NDEBUG #include +/** 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 */ @@ -49,6 +61,7 @@ BRUSHOBJ_pvAllocRbrush(IN BRUSHOBJ *BrushObj, PVOID APIENTRY BRUSHOBJ_pvGetRbrush(IN BRUSHOBJ *BrushObj) { + // FIXME: this is wrong! Read msdn. return(BrushObj->pvRbrush); } diff --git a/reactos/subsystems/win32/win32k/include/intgdi.h b/reactos/subsystems/win32/win32k/include/intgdi.h index d022801beda..e814e63c732 100644 --- a/reactos/subsystems/win32/win32k/include/intgdi.h +++ b/reactos/subsystems/win32/win32k/include/intgdi.h @@ -15,9 +15,6 @@ XLATEOBJ* FASTCALL IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, SURFACE* pDestSurf, SURFACE* pSrcSurf); -VOID FASTCALL -IntGdiInitBrushInstance(EBRUSHOBJ *BrushInst, PBRUSH BrushObj, XLATEOBJ *XlateObj); - HBRUSH APIENTRY IntGdiCreateDIBBrush( CONST BITMAPINFO *BitmapInfo, diff --git a/reactos/subsystems/win32/win32k/objects/arc.c b/reactos/subsystems/win32/win32k/objects/arc.c index e2ad4afb20e..600c0637b91 100644 --- a/reactos/subsystems/win32/win32k/objects/arc.c +++ b/reactos/subsystems/win32/win32k/objects/arc.c @@ -166,7 +166,7 @@ IntArc( DC *dc, return FALSE; } - IntGdiInitBrushInstance(&eboPen, pbrushPen, dc->rosdc.XlatePen); + EBRUSHOBJ_vInit(&eboPen, pbrushPen, dc->rosdc.XlatePen); if (arctype == GdiTypePie) { diff --git a/reactos/subsystems/win32/win32k/objects/bitblt.c b/reactos/subsystems/win32/win32k/objects/bitblt.c index 89066d4857b..9ec7f82879a 100644 --- a/reactos/subsystems/win32/win32k/objects/bitblt.c +++ b/reactos/subsystems/win32/win32k/objects/bitblt.c @@ -292,7 +292,7 @@ NtGdiBitBlt( goto cleanup; } BrushOrigin = *((PPOINTL)&pbrush->ptOrigin); - IntGdiInitBrushInstance(&BrushInst, pbrush, DCDest->rosdc.XlateBrush); + EBRUSHOBJ_vInit(&BrushInst, pbrush, DCDest->rosdc.XlateBrush); } /* Create the XLATEOBJ. */ @@ -874,7 +874,7 @@ NtGdiStretchBlt( goto failed; } BrushOrigin = *((PPOINTL)&pbrush->ptOrigin); - IntGdiInitBrushInstance(&BrushInst, pbrush, DCDest->rosdc.XlateBrush); + EBRUSHOBJ_vInit(&BrushInst, pbrush, DCDest->rosdc.XlateBrush); } /* Offset the brush */ @@ -968,7 +968,7 @@ IntPatBlt( BrushOrigin.x = BrushObj->ptOrigin.x + dc->ptlDCOrig.x; BrushOrigin.y = BrushObj->ptOrigin.y + dc->ptlDCOrig.y; - IntGdiInitBrushInstance(&eboFill, BrushObj, dc->rosdc.XlateBrush); + EBRUSHOBJ_vInit(&eboFill, BrushObj, dc->rosdc.XlateBrush); ret = IntEngBitBlt( &psurf->SurfObj, diff --git a/reactos/subsystems/win32/win32k/objects/brush.c b/reactos/subsystems/win32/win32k/objects/brush.c index 9c5c06d33e1..b2f9bbe78c6 100644 --- a/reactos/subsystems/win32/win32k/objects/brush.c +++ b/reactos/subsystems/win32/win32k/objects/brush.c @@ -166,30 +166,6 @@ IntGdiCreateBrushXlate(PDC Dc, BRUSH *pbrush, BOOLEAN *Failed) 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 * diff --git a/reactos/subsystems/win32/win32k/objects/drawing.c b/reactos/subsystems/win32/win32k/objects/drawing.c index 5dd7e02644a..83b34b4dbdf 100755 --- a/reactos/subsystems/win32/win32k/objects/drawing.c +++ b/reactos/subsystems/win32/win32k/objects/drawing.c @@ -1237,9 +1237,9 @@ IntFillRect( DC *dc, ROP = PATCOPY; if (Pen) - IntGdiInitBrushInstance(&eboFill, pbrush, dc->rosdc.XlatePen); + EBRUSHOBJ_vInit(&eboFill, pbrush, dc->rosdc.XlatePen); else - IntGdiInitBrushInstance(&eboFill, pbrush, dc->rosdc.XlateBrush); + EBRUSHOBJ_vInit(&eboFill, pbrush, dc->rosdc.XlateBrush); Ret = IntEngBitBlt( &psurf->SurfObj, diff --git a/reactos/subsystems/win32/win32k/objects/fillshap.c b/reactos/subsystems/win32/win32k/objects/fillshap.c index 324846c10b4..aace370ae78 100644 --- a/reactos/subsystems/win32/win32k/objects/fillshap.c +++ b/reactos/subsystems/win32/win32k/objects/fillshap.c @@ -107,7 +107,7 @@ IntGdiPolygon(PDC dc, BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin); BrushOrigin.x += dc->ptlDCOrig.x; 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, DestRect, &BrushOrigin); } @@ -119,7 +119,7 @@ IntGdiPolygon(PDC dc, { int i; - IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen); + EBRUSHOBJ_vInit(&eboLine, pbrushLine, dc->rosdc.XlatePen); for (i = 0; i < Count-1; i++) { @@ -600,7 +600,7 @@ IntRectangle(PDC dc, BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin); BrushOrigin.x += dc->ptlDCOrig.x; BrushOrigin.y += dc->ptlDCOrig.y; - IntGdiInitBrushInstance(&eboFill, pbrushFill, dc->rosdc.XlateBrush); + EBRUSHOBJ_vInit(&eboFill, pbrushFill, dc->rosdc.XlateBrush); ret = IntEngBitBlt(&psurf->SurfObj, 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 @@ -1147,7 +1147,7 @@ NtGdiExtFloodFill( BrushOrigin = *((PPOINTL)&pbrushFill->ptOrigin); BrushOrigin.x += dc->ptlDCOrig.x; BrushOrigin.y += dc->ptlDCOrig.y; - IntGdiInitBrushInstance(&eboFill, pbrushFill, dc->rosdc.XlateBrush); + EBRUSHOBJ_vInit(&eboFill, pbrushFill, dc->rosdc.XlateBrush); Ret = IntEngBitBlt(&psurf->SurfObj, NULL, NULL, dc->rosdc.CombinedClip, NULL, &DestRect, NULL, NULL, diff --git a/reactos/subsystems/win32/win32k/objects/freetype.c b/reactos/subsystems/win32/win32k/objects/freetype.c index 5eee4c8935a..39b53d000ff 100644 --- a/reactos/subsystems/win32/win32k/objects/freetype.c +++ b/reactos/subsystems/win32/win32k/objects/freetype.c @@ -3237,7 +3237,7 @@ GreExtTextOutW( { goto fail; } - IntGdiInitBrushInstance(&eboText, pbrushText, NULL); + EBRUSHOBJ_vInit(&eboText, pbrushText, NULL); if ((fuOptions & ETO_OPAQUE) || pdcattr->jBkMode == OPAQUE) { hbrushBackGnd = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, pdcattr->crBackgroundClr), 0); @@ -3250,7 +3250,7 @@ GreExtTextOutW( { goto fail; } - IntGdiInitBrushInstance(&eboBackGnd, pbrushBackGnd, NULL); + EBRUSHOBJ_vInit(&eboBackGnd, pbrushBackGnd, NULL); } XlateObj2 = (XLATEOBJ*)IntEngCreateXlate(PAL_RGB, Mode, NULL, hDestPalette); if ( !XlateObj2 ) diff --git a/reactos/subsystems/win32/win32k/objects/line.c b/reactos/subsystems/win32/win32k/objects/line.c index 043fe3d7543..48fff26a460 100644 --- a/reactos/subsystems/win32/win32k/objects/line.c +++ b/reactos/subsystems/win32/win32k/objects/line.c @@ -154,7 +154,7 @@ IntGdiLineTo(DC *dc, if (!(pbrushLine->flAttrs & GDIBRUSH_IS_NULL)) { - IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen); + EBRUSHOBJ_vInit(&eboLine, pbrushLine, dc->rosdc.XlatePen); Ret = IntEngLineTo(&psurf->SurfObj, dc->rosdc.CombinedClip, &eboLine.BrushObject, @@ -292,7 +292,7 @@ IntGdiPolyline(DC *dc, Points[i].y += dc->ptlDCOrig.y; } - IntGdiInitBrushInstance(&eboLine, pbrushLine, dc->rosdc.XlatePen); + EBRUSHOBJ_vInit(&eboLine, pbrushLine, dc->rosdc.XlatePen); Ret = IntEngPolyline(&psurf->SurfObj, dc->rosdc.CombinedClip, &eboLine.BrushObject, diff --git a/reactos/subsystems/win32/win32k/objects/region.c b/reactos/subsystems/win32/win32k/objects/region.c index 687f6438552..d45a8bf80b8 100644 --- a/reactos/subsystems/win32/win32k/objects/region.c +++ b/reactos/subsystems/win32/win32k/objects/region.c @@ -2937,7 +2937,7 @@ IntGdiPaintRgn( ASSERT(ClipRegion); pbrush = BRUSH_LockBrush(pdcattr->hbrush); ASSERT(pbrush); - IntGdiInitBrushInstance(&eboFill, pbrush, dc->rosdc.XlateBrush); + EBRUSHOBJ_vInit(&eboFill, pbrush, dc->rosdc.XlateBrush); BrushOrigin.x = pdcattr->ptlBrushOrigin.x; BrushOrigin.y = pdcattr->ptlBrushOrigin.y;