mirror of
https://github.com/reactos/reactos.git
synced 2024-07-06 12:45:16 +00:00
[win32k] Implement brush realization part 2 / 2
Use EBRUSHOBJ_pvGetEngBrush to get a handle to the realized (color translated) brush and use this instead of the original pattern when doing patblts. We don't use any XLATEOBJ anymore. I'll leave it to the interested reader to cleanup the DIB code from remnants of pattern to dest color translation. svn path=/trunk/; revision=41892
This commit is contained in:
parent
9e97547323
commit
ba31bc03ca
|
@ -48,9 +48,8 @@ BltMask(SURFOBJ* psoDest,
|
|||
LONG PatternX0 = 0, PatternX = 0, PatternY = 0;
|
||||
PFN_DIB_PutPixel fnDest_PutPixel = NULL;
|
||||
PFN_DIB_GetPixel fnPattern_GetPixel = NULL;
|
||||
XLATEOBJ *XlateObj;
|
||||
ULONG Pattern = 0;
|
||||
SURFACE *psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
HBITMAP hbmPattern;
|
||||
|
||||
if (psoMask == NULL)
|
||||
{
|
||||
|
@ -61,7 +60,8 @@ BltMask(SURFOBJ* psoDest,
|
|||
{
|
||||
pebo = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
|
||||
|
||||
psurfPattern = SURFACE_LockSurface(pebo->pbrush->hbmPattern);
|
||||
hbmPattern = EBRUSHOBJ_pvGetEngBrush(pebo);
|
||||
psurfPattern = SURFACE_LockSurface(hbmPattern);
|
||||
if (psurfPattern != NULL)
|
||||
{
|
||||
psoPattern = &psurfPattern->SurfObj;
|
||||
|
@ -79,9 +79,6 @@ BltMask(SURFOBJ* psoDest,
|
|||
fnDest_PutPixel = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel;
|
||||
if (psurfPattern)
|
||||
{
|
||||
XlateObj = IntCreateBrushXlate(pebo->pbrush,
|
||||
psurfDest,
|
||||
pebo->crCurrentBack);
|
||||
PatternY = (prclDest->top - pptlBrush->y) % PatternHeight;
|
||||
if (PatternY < 0)
|
||||
{
|
||||
|
@ -104,8 +101,7 @@ BltMask(SURFOBJ* psoDest,
|
|||
if (*pjMskCurrent & fjMaskBit)
|
||||
{
|
||||
fnDest_PutPixel(psoDest, x, y,
|
||||
XLATEOBJ_iXlate(XlateObj,
|
||||
fnPattern_GetPixel(psoPattern, PatternX, PatternY)));
|
||||
fnPattern_GetPixel(psoPattern, PatternX, PatternY));
|
||||
}
|
||||
fjMaskBit = _rotr8(fjMaskBit, 1);
|
||||
pjMskCurrent += (fjMaskBit >> 7);
|
||||
|
@ -116,9 +112,6 @@ BltMask(SURFOBJ* psoDest,
|
|||
PatternY++;
|
||||
PatternY %= PatternHeight;
|
||||
}
|
||||
|
||||
if (XlateObj)
|
||||
EngDeleteXlate(XlateObj);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -183,8 +176,7 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
|||
PEBRUSHOBJ GdiBrush = NULL;
|
||||
SURFACE *psurfPattern;
|
||||
BOOLEAN Result;
|
||||
SURFACE *psurfDest = CONTAINING_RECORD(OutputObj, SURFACE, SurfObj);
|
||||
XLATEOBJ *XlatePatternToDest = NULL;
|
||||
HBITMAP hbmPattern;
|
||||
|
||||
BltInfo.DestSurface = OutputObj;
|
||||
BltInfo.SourceSurface = InputObj;
|
||||
|
@ -205,7 +197,9 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
|||
if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
|
||||
if ((psurfPattern = SURFACE_LockSurface(GdiBrush->pbrush->hbmPattern)))
|
||||
hbmPattern = EBRUSHOBJ_pvGetEngBrush(GdiBrush);
|
||||
psurfPattern = SURFACE_LockSurface(hbmPattern);
|
||||
if (psurfPattern)
|
||||
{
|
||||
BltInfo.PatternSurface = &psurfPattern->SurfObj;
|
||||
}
|
||||
|
@ -213,10 +207,6 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
|||
{
|
||||
/* FIXME - What to do here? */
|
||||
}
|
||||
XlatePatternToDest = IntCreateBrushXlate(GdiBrush->pbrush,
|
||||
psurfDest,
|
||||
GdiBrush->crCurrentBack);
|
||||
BltInfo.XlatePatternToDest = XlatePatternToDest;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -225,11 +215,8 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
|||
|
||||
Result = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBlt(&BltInfo);
|
||||
|
||||
if (XlatePatternToDest)
|
||||
EngDeleteXlate(XlatePatternToDest);
|
||||
|
||||
/* Pattern brush */
|
||||
if (psurfPattern != NULL)
|
||||
if (psurfPattern)
|
||||
{
|
||||
SURFACE_UnlockSurface(psurfPattern);
|
||||
}
|
||||
|
|
|
@ -276,10 +276,12 @@ BRUSHOBJ_pvGetRbrush(
|
|||
if (!bResult)
|
||||
{
|
||||
if (pbo->pvRbrush)
|
||||
{
|
||||
EngFreeMem(pbo->pvRbrush);
|
||||
pbo->pvRbrush = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pbo->pvRbrush;
|
||||
}
|
||||
|
|
|
@ -38,9 +38,8 @@ CallDibStretchBlt(SURFOBJ* psoDest,
|
|||
SURFACE* psurfPattern;
|
||||
PEBRUSHOBJ GdiBrush = NULL;
|
||||
SURFOBJ* PatternSurface = NULL;
|
||||
XLATEOBJ* XlatePatternToDest = NULL;
|
||||
BOOL bResult;
|
||||
SURFACE *psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
||||
HBITMAP hbmPattern;
|
||||
|
||||
if (BrushOrigin == NULL)
|
||||
{
|
||||
|
@ -55,7 +54,8 @@ CallDibStretchBlt(SURFOBJ* psoDest,
|
|||
if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
|
||||
psurfPattern = SURFACE_LockSurface(GdiBrush->pbrush->hbmPattern);
|
||||
hbmPattern = EBRUSHOBJ_pvGetEngBrush(GdiBrush);
|
||||
psurfPattern = SURFACE_LockSurface(hbmPattern);
|
||||
if (psurfPattern)
|
||||
{
|
||||
PatternSurface = &psurfPattern->SurfObj;
|
||||
|
@ -64,9 +64,6 @@ CallDibStretchBlt(SURFOBJ* psoDest,
|
|||
{
|
||||
/* FIXME - What to do here? */
|
||||
}
|
||||
XlatePatternToDest = IntCreateBrushXlate(GdiBrush->pbrush,
|
||||
psurfDest,
|
||||
GdiBrush->crCurrentBack);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -76,12 +73,7 @@ CallDibStretchBlt(SURFOBJ* psoDest,
|
|||
bResult = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_StretchBlt(
|
||||
psoDest, psoSource, Mask, PatternSurface,
|
||||
OutputRect, InputRect, MaskOrigin, pbo, &RealBrushOrigin,
|
||||
ColorTranslation, XlatePatternToDest, Rop4);
|
||||
|
||||
if (XlatePatternToDest)
|
||||
{
|
||||
EngDeleteXlate(XlatePatternToDest);
|
||||
}
|
||||
ColorTranslation, NULL, Rop4);
|
||||
|
||||
/* Pattern brush */
|
||||
if (psurfPattern)
|
||||
|
|
|
@ -124,4 +124,8 @@ VOID
|
|||
NTAPI
|
||||
EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo);
|
||||
|
||||
PVOID
|
||||
NTAPI
|
||||
EBRUSHOBJ_pvGetEngBrush(EBRUSHOBJ *pebo);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue