Simple temporary implementation of EngRealizeBrush. Not tested, not used yet.

svn path=/trunk/; revision=40278
This commit is contained in:
Timo Kreuzer 2009-03-29 01:43:09 +00:00
parent d32f5cf257
commit c14d3364c7
2 changed files with 45 additions and 5 deletions

View file

@ -27,8 +27,48 @@ EngRealizeBrush(
XLATEOBJ *pxlo,
ULONG iHatch)
{
UNIMPLEMENTED;
return FALSE;
EBRUSHOBJ *pebo;
HBITMAP hbmpRealize;
SURFOBJ *psoRealize;
POINTL ptlSrc = {0, 0};
RECTL rclDest;
ULONG lWidth;
rclDest = (RECTL){0, 0, psoPattern->sizlBitmap.cx, psoPattern->sizlBitmap.cy};
/* Calculate width in bytes of the realized brush */
lWidth = DIB_GetDIBWidthBytes(psoPattern->sizlBitmap.cx,
BitsPerFormat(psoDst->iBitmapFormat));
/* Allocate a bitmap */
hbmpRealize = EngCreateBitmap(psoPattern->sizlBitmap,
lWidth,
psoDst->iBitmapFormat,
BMF_NOZEROINIT,
NULL);
if (!hbmpRealize)
{
return FALSE;
}
/* Lock the bitmap */
psoRealize = EngLockSurface(hbmpRealize);
if (!psoRealize)
{
EngDeleteSurface(hbmpRealize);
return FALSE;
}
/* Copy the bits to the new format bitmap */
EngCopyBits(psoRealize, psoPattern, NULL, pxlo, &rclDest, &ptlSrc);
/* Unlock the bitmap again */
EngUnlockSurface(psoRealize);
pebo = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
pebo->pengbrush = (PVOID)hbmpRealize;
return TRUE;
}
VOID
@ -61,6 +101,7 @@ EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, XLATEOBJ *pxlo)
// EBRUSHOBJ_bRealizeBrush(pebo);
}
// pebo->psurfTrg = psurfTrg;
pebo->BrushObject.pvRbrush = pbrush->ulRealization;
pebo->BrushObject.flColorType = 0;
pebo->pbrush = pbrush;
@ -91,7 +132,7 @@ EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo)
psurfTrg = pebo->psurfTrg; // FIXME: all EBRUSHOBJs need a surface
ppdev = (PPDEVOBJ)psurfTrg->SurfObj.hdev; // FIXME: all SURFACEs need a PDEV
pfnRealzizeBrush = ppdev->DriverFunctions.RealizeBrush;
pfnRealzizeBrush = NULL;//ppdev->DriverFunctions.RealizeBrush;
if (!pfnRealzizeBrush)
{
pfnRealzizeBrush = EngRealizeBrush;

View file

@ -14,7 +14,6 @@
* DON'T MODIFY THIS STRUCTURE UNLESS REALLY NEEDED AND EVEN THEN ASK ON
* A MAILING LIST FIRST.
*/
typedef struct _BRUSH
{
/* Header for all gdi objects in the handle table.
@ -50,7 +49,7 @@ typedef struct _EBRUSHOBJ
COLORREF crRealize;
ULONG ulRGBColor;
DWORD pengbrush;
PVOID pengbrush;
ULONG ulSurfPalTime;
ULONG ulDCPalTime;
COLORREF crCurrentText;