Author: tkreuzer
Date: Wed Feb 11 21:35:48 2015
New Revision: 66231
URL:
http://svn.reactos.org/svn/reactos?rev=66231&view=rev
Log:
[WIN32K]
Implement support for hatch brush masks.
Modified:
trunk/reactos/win32ss/gdi/eng/engbrush.c
Modified: trunk/reactos/win32ss/gdi/eng/engbrush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engbrush.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] Wed Feb 11 21:35:48 2015
@@ -424,7 +424,37 @@
NTAPI
EBRUSHOBJ_psoMask(EBRUSHOBJ *pebo)
{
- return NULL;
+ HBITMAP hbmMask;
+ PSURFACE psurfMask;
+ PPDEVOBJ ppdev;
+
+ /* Check if we don't have a mask yet */
+ if (pebo->psoMask == NULL)
+ {
+ /* Check if this is a hatch brush */
+ if (pebo->flattrs & BR_IS_HATCH)
+ {
+ /* Get the PDEV */
+ ppdev = (PPDEVOBJ)pebo->psurfTrg->SurfObj.hdev;
+ if (!ppdev)
+ ppdev = gppdevPrimary;
+
+ /* Use the hatch bitmap as the mask */
+ hbmMask = (HBITMAP)ppdev->ahsurf[pebo->pbrush->iHatch];
+ psurfMask = SURFACE_ShareLockSurface(hbmMask);
+ if (psurfMask == NULL)
+ {
+ ERR("Failed to lock hatch brush for PDEV %p, iHatch %lu\n",
+ ppdev, pebo->pbrush->iHatch);
+ return NULL;
+ }
+
+ NT_ASSERT(psurfMask->SurfObj.iBitmapFormat == BMF_1BPP);
+ pebo->psoMask = &psurfMask->SurfObj;
+ }
+ }
+
+ return pebo->psoMask;
}
/** Exported DDI functions ****************************************************/