mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 16:12:58 +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
4 changed files with 36 additions and 51 deletions
|
@ -48,9 +48,8 @@ BltMask(SURFOBJ* psoDest,
|
||||||
LONG PatternX0 = 0, PatternX = 0, PatternY = 0;
|
LONG PatternX0 = 0, PatternX = 0, PatternY = 0;
|
||||||
PFN_DIB_PutPixel fnDest_PutPixel = NULL;
|
PFN_DIB_PutPixel fnDest_PutPixel = NULL;
|
||||||
PFN_DIB_GetPixel fnPattern_GetPixel = NULL;
|
PFN_DIB_GetPixel fnPattern_GetPixel = NULL;
|
||||||
XLATEOBJ *XlateObj;
|
|
||||||
ULONG Pattern = 0;
|
ULONG Pattern = 0;
|
||||||
SURFACE *psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
HBITMAP hbmPattern;
|
||||||
|
|
||||||
if (psoMask == NULL)
|
if (psoMask == NULL)
|
||||||
{
|
{
|
||||||
|
@ -61,7 +60,8 @@ BltMask(SURFOBJ* psoDest,
|
||||||
{
|
{
|
||||||
pebo = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
|
pebo = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
|
||||||
|
|
||||||
psurfPattern = SURFACE_LockSurface(pebo->pbrush->hbmPattern);
|
hbmPattern = EBRUSHOBJ_pvGetEngBrush(pebo);
|
||||||
|
psurfPattern = SURFACE_LockSurface(hbmPattern);
|
||||||
if (psurfPattern != NULL)
|
if (psurfPattern != NULL)
|
||||||
{
|
{
|
||||||
psoPattern = &psurfPattern->SurfObj;
|
psoPattern = &psurfPattern->SurfObj;
|
||||||
|
@ -79,9 +79,6 @@ BltMask(SURFOBJ* psoDest,
|
||||||
fnDest_PutPixel = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel;
|
fnDest_PutPixel = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel;
|
||||||
if (psurfPattern)
|
if (psurfPattern)
|
||||||
{
|
{
|
||||||
XlateObj = IntCreateBrushXlate(pebo->pbrush,
|
|
||||||
psurfDest,
|
|
||||||
pebo->crCurrentBack);
|
|
||||||
PatternY = (prclDest->top - pptlBrush->y) % PatternHeight;
|
PatternY = (prclDest->top - pptlBrush->y) % PatternHeight;
|
||||||
if (PatternY < 0)
|
if (PatternY < 0)
|
||||||
{
|
{
|
||||||
|
@ -104,8 +101,7 @@ BltMask(SURFOBJ* psoDest,
|
||||||
if (*pjMskCurrent & fjMaskBit)
|
if (*pjMskCurrent & fjMaskBit)
|
||||||
{
|
{
|
||||||
fnDest_PutPixel(psoDest, x, y,
|
fnDest_PutPixel(psoDest, x, y,
|
||||||
XLATEOBJ_iXlate(XlateObj,
|
fnPattern_GetPixel(psoPattern, PatternX, PatternY));
|
||||||
fnPattern_GetPixel(psoPattern, PatternX, PatternY)));
|
|
||||||
}
|
}
|
||||||
fjMaskBit = _rotr8(fjMaskBit, 1);
|
fjMaskBit = _rotr8(fjMaskBit, 1);
|
||||||
pjMskCurrent += (fjMaskBit >> 7);
|
pjMskCurrent += (fjMaskBit >> 7);
|
||||||
|
@ -116,9 +112,6 @@ BltMask(SURFOBJ* psoDest,
|
||||||
PatternY++;
|
PatternY++;
|
||||||
PatternY %= PatternHeight;
|
PatternY %= PatternHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XlateObj)
|
|
||||||
EngDeleteXlate(XlateObj);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -183,8 +176,7 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
||||||
PEBRUSHOBJ GdiBrush = NULL;
|
PEBRUSHOBJ GdiBrush = NULL;
|
||||||
SURFACE *psurfPattern;
|
SURFACE *psurfPattern;
|
||||||
BOOLEAN Result;
|
BOOLEAN Result;
|
||||||
SURFACE *psurfDest = CONTAINING_RECORD(OutputObj, SURFACE, SurfObj);
|
HBITMAP hbmPattern;
|
||||||
XLATEOBJ *XlatePatternToDest = NULL;
|
|
||||||
|
|
||||||
BltInfo.DestSurface = OutputObj;
|
BltInfo.DestSurface = OutputObj;
|
||||||
BltInfo.SourceSurface = InputObj;
|
BltInfo.SourceSurface = InputObj;
|
||||||
|
@ -205,7 +197,9 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
||||||
if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF)
|
if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
|
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;
|
BltInfo.PatternSurface = &psurfPattern->SurfObj;
|
||||||
}
|
}
|
||||||
|
@ -213,10 +207,6 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
||||||
{
|
{
|
||||||
/* FIXME - What to do here? */
|
/* FIXME - What to do here? */
|
||||||
}
|
}
|
||||||
XlatePatternToDest = IntCreateBrushXlate(GdiBrush->pbrush,
|
|
||||||
psurfDest,
|
|
||||||
GdiBrush->crCurrentBack);
|
|
||||||
BltInfo.XlatePatternToDest = XlatePatternToDest;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -225,11 +215,8 @@ CallDibBitBlt(SURFOBJ* OutputObj,
|
||||||
|
|
||||||
Result = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBlt(&BltInfo);
|
Result = DibFunctionsForBitmapFormat[OutputObj->iBitmapFormat].DIB_BitBlt(&BltInfo);
|
||||||
|
|
||||||
if (XlatePatternToDest)
|
|
||||||
EngDeleteXlate(XlatePatternToDest);
|
|
||||||
|
|
||||||
/* Pattern brush */
|
/* Pattern brush */
|
||||||
if (psurfPattern != NULL)
|
if (psurfPattern)
|
||||||
{
|
{
|
||||||
SURFACE_UnlockSurface(psurfPattern);
|
SURFACE_UnlockSurface(psurfPattern);
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,10 +276,12 @@ BRUSHOBJ_pvGetRbrush(
|
||||||
if (!bResult)
|
if (!bResult)
|
||||||
{
|
{
|
||||||
if (pbo->pvRbrush)
|
if (pbo->pvRbrush)
|
||||||
|
{
|
||||||
EngFreeMem(pbo->pvRbrush);
|
EngFreeMem(pbo->pvRbrush);
|
||||||
pbo->pvRbrush = NULL;
|
pbo->pvRbrush = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return pbo->pvRbrush;
|
return pbo->pvRbrush;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,9 +38,8 @@ CallDibStretchBlt(SURFOBJ* psoDest,
|
||||||
SURFACE* psurfPattern;
|
SURFACE* psurfPattern;
|
||||||
PEBRUSHOBJ GdiBrush = NULL;
|
PEBRUSHOBJ GdiBrush = NULL;
|
||||||
SURFOBJ* PatternSurface = NULL;
|
SURFOBJ* PatternSurface = NULL;
|
||||||
XLATEOBJ* XlatePatternToDest = NULL;
|
|
||||||
BOOL bResult;
|
BOOL bResult;
|
||||||
SURFACE *psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
|
HBITMAP hbmPattern;
|
||||||
|
|
||||||
if (BrushOrigin == NULL)
|
if (BrushOrigin == NULL)
|
||||||
{
|
{
|
||||||
|
@ -55,7 +54,8 @@ CallDibStretchBlt(SURFOBJ* psoDest,
|
||||||
if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF)
|
if (ROP4_USES_PATTERN(Rop4) && pbo && pbo->iSolidColor == 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
|
GdiBrush = CONTAINING_RECORD(pbo, EBRUSHOBJ, BrushObject);
|
||||||
psurfPattern = SURFACE_LockSurface(GdiBrush->pbrush->hbmPattern);
|
hbmPattern = EBRUSHOBJ_pvGetEngBrush(GdiBrush);
|
||||||
|
psurfPattern = SURFACE_LockSurface(hbmPattern);
|
||||||
if (psurfPattern)
|
if (psurfPattern)
|
||||||
{
|
{
|
||||||
PatternSurface = &psurfPattern->SurfObj;
|
PatternSurface = &psurfPattern->SurfObj;
|
||||||
|
@ -64,9 +64,6 @@ CallDibStretchBlt(SURFOBJ* psoDest,
|
||||||
{
|
{
|
||||||
/* FIXME - What to do here? */
|
/* FIXME - What to do here? */
|
||||||
}
|
}
|
||||||
XlatePatternToDest = IntCreateBrushXlate(GdiBrush->pbrush,
|
|
||||||
psurfDest,
|
|
||||||
GdiBrush->crCurrentBack);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -76,12 +73,7 @@ CallDibStretchBlt(SURFOBJ* psoDest,
|
||||||
bResult = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_StretchBlt(
|
bResult = DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_StretchBlt(
|
||||||
psoDest, psoSource, Mask, PatternSurface,
|
psoDest, psoSource, Mask, PatternSurface,
|
||||||
OutputRect, InputRect, MaskOrigin, pbo, &RealBrushOrigin,
|
OutputRect, InputRect, MaskOrigin, pbo, &RealBrushOrigin,
|
||||||
ColorTranslation, XlatePatternToDest, Rop4);
|
ColorTranslation, NULL, Rop4);
|
||||||
|
|
||||||
if (XlatePatternToDest)
|
|
||||||
{
|
|
||||||
EngDeleteXlate(XlatePatternToDest);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Pattern brush */
|
/* Pattern brush */
|
||||||
if (psurfPattern)
|
if (psurfPattern)
|
||||||
|
|
|
@ -124,4 +124,8 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo);
|
EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo);
|
||||||
|
|
||||||
|
PVOID
|
||||||
|
NTAPI
|
||||||
|
EBRUSHOBJ_pvGetEngBrush(EBRUSHOBJ *pebo);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue