From bbbd338d8198ef799bca073da1d38abd241e949b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 2 May 2012 18:55:23 +0000 Subject: [PATCH] [WIN32K] - Add some code stub and comments for realizing DIB brush palettes - Move some function prototypes svn path=/trunk/; revision=56477 --- reactos/win32ss/gdi/eng/engbrush.c | 17 ++++++++++++++++- reactos/win32ss/gdi/ntgdi/brush.h | 13 +++++++++++++ reactos/win32ss/gdi/ntgdi/intgdi.h | 14 -------------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/reactos/win32ss/gdi/eng/engbrush.c b/reactos/win32ss/gdi/eng/engbrush.c index 898d9bbd85c..0fb8f5310d6 100644 --- a/reactos/win32ss/gdi/eng/engbrush.c +++ b/reactos/win32ss/gdi/eng/engbrush.c @@ -38,6 +38,7 @@ EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc) pebo->ppalSurf = pebo->psurfTrg->ppal; GDIOBJ_vReferenceObjectByPointer(&pebo->ppalSurf->BaseObject); + //pebo->ppalDC = pdc->dclevel.ppal; if (pbrush->flAttrs & GDIBRUSH_IS_NULL) { @@ -194,6 +195,7 @@ EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver) PSURFACE psurfPattern, psurfMask; PPDEVOBJ ppdev = NULL; EXLATEOBJ exlo; + PPALETTE ppalPattern; /* All EBRUSHOBJs have a surface, see EBRUSHOBJ_vInit */ ASSERT(pebo->psurfTrg); @@ -214,9 +216,22 @@ EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver) /* FIXME: implement mask */ psurfMask = NULL; + /* DIB brushes with DIB_PAL_COLORS usage need a new palette */ + if (pebo->pbrush->flAttrs & GDIBRUSH_IS_DIBPALCOLORS) + { + ASSERT(FALSE); + ppalPattern = 0; //CreateDIBPalette(psurfPattern->ppal, pebo->ppalDC); + // pebo->ppalDIB = ppalPattern; + } + else + { + /* The palette is already as it should be */ + ppalPattern = psurfPattern->ppal; + } + /* Initialize XLATEOBJ for the brush */ EXLATEOBJ_vInitialize(&exlo, - psurfPattern->ppal, + ppalPattern, pebo->psurfTrg->ppal, 0, pebo->crCurrentBack, diff --git a/reactos/win32ss/gdi/ntgdi/brush.h b/reactos/win32ss/gdi/ntgdi/brush.h index be4323aa7b7..267216dcb15 100644 --- a/reactos/win32ss/gdi/ntgdi/brush.h +++ b/reactos/win32ss/gdi/ntgdi/brush.h @@ -141,3 +141,16 @@ EBRUSHOBJ_iSetSolidColor(EBRUSHOBJ *pebo, ULONG iSolidColor) BOOL FASTCALL IntGdiSetBrushOwner(PBRUSH,DWORD); BOOL FASTCALL GreSetBrushOwner(HBRUSH,DWORD); +HBRUSH APIENTRY +IntGdiCreatePatternBrush( + HBITMAP hBitmap); + +HBRUSH APIENTRY +IntGdiCreateSolidBrush( + COLORREF Color); + +HBRUSH APIENTRY +IntGdiCreateNullBrush(VOID); + +VOID FASTCALL +IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color); diff --git a/reactos/win32ss/gdi/ntgdi/intgdi.h b/reactos/win32ss/gdi/ntgdi/intgdi.h index 967751d55f7..d7aa777b094 100644 --- a/reactos/win32ss/gdi/ntgdi/intgdi.h +++ b/reactos/win32ss/gdi/ntgdi/intgdi.h @@ -5,20 +5,6 @@ extern HDC hSystemBM; extern HSEMAPHORE hsemDriverMgmt; -HBRUSH APIENTRY -IntGdiCreatePatternBrush( - HBITMAP hBitmap); - -HBRUSH APIENTRY -IntGdiCreateSolidBrush( - COLORREF Color); - -HBRUSH APIENTRY -IntGdiCreateNullBrush(VOID); - -VOID FASTCALL -IntGdiSetSolidBrushColor(HBRUSH hBrush, COLORREF Color); - /* Line functions */ BOOL FASTCALL