Author: tkreuzer
Date: Sun Mar 29 05:43:09 2009
New Revision: 40278
URL:
http://svn.reactos.org/svn/reactos?rev=40278&view=rev
Log:
Simple temporary implementation of EngRealizeBrush. Not tested, not used yet.
Modified:
trunk/reactos/subsystems/win32/win32k/eng/engbrush.c
trunk/reactos/subsystems/win32/win32k/include/brush.h
Modified: trunk/reactos/subsystems/win32/win32k/eng/engbrush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/engbrush.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/engbrush.c [iso-8859-1] Sun Mar 29 05:43:09
2009
@@ -27,8 +27,48 @@
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_bRealizeBrush(pebo);
}
+// pebo->psurfTrg = psurfTrg;
pebo->BrushObject.pvRbrush = pbrush->ulRealization;
pebo->BrushObject.flColorType = 0;
pebo->pbrush = pbrush;
@@ -91,7 +132,7 @@
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;
Modified: trunk/reactos/subsystems/win32/win32k/include/brush.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/brush.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/brush.h [iso-8859-1] Sun Mar 29 05:43:09
2009
@@ -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 @@
COLORREF crRealize;
ULONG ulRGBColor;
- DWORD pengbrush;
+ PVOID pengbrush;
ULONG ulSurfPalTime;
ULONG ulDCPalTime;
COLORREF crCurrentText;