mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:56:05 +00:00
[DIBLIB]
Fix calculation of pattern pointer [WIN32K] Fix (almost) calculation of pattern origin. There's still a bugger left. svn path=/trunk/; revision=56388
This commit is contained in:
parent
e3411f18ca
commit
85b693d42d
2 changed files with 30 additions and 8 deletions
|
@ -44,10 +44,7 @@ _DibFunction(PBLTDATA pBltData)
|
||||||
#if __USES_PATTERN
|
#if __USES_PATTERN
|
||||||
pjPatBase = pBltData->siPat.pjBase;
|
pjPatBase = pBltData->siPat.pjBase;
|
||||||
pjPatBase += pBltData->siPat.ptOrig.y * pBltData->siPat.lDelta;
|
pjPatBase += pBltData->siPat.ptOrig.y * pBltData->siPat.lDelta;
|
||||||
pjPattern = pjPatBase + pBltData->siPat.ptOrig.x * _DEST_BPP / 8;
|
|
||||||
_CALCSHIFT(_DEST_BPP, &jPatShift, pBltData->siPat.ptOrig.x);
|
|
||||||
cPatLines = pBltData->ulPatHeight - pBltData->siPat.ptOrig.y;
|
cPatLines = pBltData->ulPatHeight - pBltData->siPat.ptOrig.y;
|
||||||
cPatRows = pBltData->ulPatWidth - pBltData->siPat.ptOrig.x;
|
|
||||||
#endif
|
#endif
|
||||||
pjDestBase = pBltData->siDst.pjBase;
|
pjDestBase = pBltData->siDst.pjBase;
|
||||||
#if __USES_SOURCE
|
#if __USES_SOURCE
|
||||||
|
@ -69,6 +66,11 @@ _DibFunction(PBLTDATA pBltData)
|
||||||
pjMask = pjMaskBase;
|
pjMask = pjMaskBase;
|
||||||
_CALCSHIFT_1(&jMskShift, pBltData->siMsk.ptOrig.x);
|
_CALCSHIFT_1(&jMskShift, pBltData->siMsk.ptOrig.x);
|
||||||
#endif
|
#endif
|
||||||
|
#if __USES_PATTERN
|
||||||
|
pjPattern = pjPatBase + pBltData->siPat.ptOrig.x * _DEST_BPP / 8;
|
||||||
|
_CALCSHIFT(_DEST_BPP, &jPatShift, pBltData->siPat.ptOrig.x);
|
||||||
|
cPatRows = pBltData->ulPatWidth - pBltData->siPat.ptOrig.x;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Loop all rows */
|
/* Loop all rows */
|
||||||
cRows = pBltData->ulWidth;
|
cRows = pBltData->ulWidth;
|
||||||
|
|
|
@ -72,10 +72,22 @@ CalculateCoordinates(
|
||||||
{
|
{
|
||||||
/* Calculate start point and bitpointer for pattern */
|
/* Calculate start point and bitpointer for pattern */
|
||||||
pbltdata->siPat.ptOrig.x = (pptlPat->x + cx) % psizlPat->cx;
|
pbltdata->siPat.ptOrig.x = (pptlPat->x + cx) % psizlPat->cx;
|
||||||
pbltdata->siPat.ptOrig.y = (pptlPat->x + cy) % psizlPat->cy;
|
pbltdata->siPat.ptOrig.y = (pptlPat->y + cy) % psizlPat->cy;
|
||||||
pbltdata->siPat.pjBase = pbltdata->siPat.pvScan0;
|
pbltdata->siPat.pjBase = pbltdata->siPat.pvScan0;
|
||||||
pbltdata->siPat.pjBase += pbltdata->siPat.ptOrig.y * pbltdata->siPat.lDelta;
|
|
||||||
pbltdata->siPat.pjBase += pbltdata->siPat.ptOrig.x * pbltdata->siPat.jBpp / 8;
|
/* Check for bottom-up case */
|
||||||
|
if (pbltdata->dy < 0)
|
||||||
|
{
|
||||||
|
pbltdata->siPat.pjBase += (psizlPat->cy - 1) * pbltdata->siPat.lDelta;
|
||||||
|
pbltdata->siPat.ptOrig.y = psizlPat->cy - 1 - pbltdata->siPat.ptOrig.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for right-to-left case */
|
||||||
|
if (pbltdata->siDst.iFormat == 0)
|
||||||
|
{
|
||||||
|
pbltdata->siPat.pjBase += (psizlPat->cx - 1) * pbltdata->siMsk.jBpp / 8;
|
||||||
|
pbltdata->siPat.ptOrig.x = psizlPat->cx - 1 - pbltdata->siPat.ptOrig.x;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,7 +381,7 @@ IntEngBitBlt(
|
||||||
{
|
{
|
||||||
BOOL bResult;
|
BOOL bResult;
|
||||||
RECTL rcClipped;
|
RECTL rcClipped;
|
||||||
POINTL ptOffset, ptSrc, ptMask;
|
POINTL ptOffset, ptSrc, ptMask, ptBrush;
|
||||||
SIZEL sizTrg;
|
SIZEL sizTrg;
|
||||||
PFN_DrvBitBlt pfnBitBlt;
|
PFN_DrvBitBlt pfnBitBlt;
|
||||||
|
|
||||||
|
@ -461,6 +473,14 @@ IntEngBitBlt(
|
||||||
ptMask.x += ptOffset.x;
|
ptMask.x += ptOffset.x;
|
||||||
ptMask.y += ptOffset.y;
|
ptMask.y += ptOffset.y;
|
||||||
|
|
||||||
|
/* Check if we have a brush origin */
|
||||||
|
if (pptlBrush)
|
||||||
|
{
|
||||||
|
/* calculate the new brush origin */
|
||||||
|
ptBrush.x = pptlBrush->x + ptOffset.x;
|
||||||
|
ptBrush.y = pptlBrush->y + ptOffset.y;
|
||||||
|
}
|
||||||
|
|
||||||
/* Recalculate the target rect */
|
/* Recalculate the target rect */
|
||||||
rcClipped.left = prclTrg->left + ptOffset.x;
|
rcClipped.left = prclTrg->left + ptOffset.x;
|
||||||
rcClipped.top = prclTrg->top + ptOffset.y;
|
rcClipped.top = prclTrg->top + ptOffset.y;
|
||||||
|
@ -499,7 +519,7 @@ IntEngBitBlt(
|
||||||
psoSrc ? &ptSrc : NULL,
|
psoSrc ? &ptSrc : NULL,
|
||||||
psoMask ? &ptMask : NULL,
|
psoMask ? &ptMask : NULL,
|
||||||
pbo,
|
pbo,
|
||||||
pptlBrush,
|
pptlBrush ? &ptBrush : NULL,
|
||||||
rop4);
|
rop4);
|
||||||
|
|
||||||
// FIXME: cleanup temp surface!
|
// FIXME: cleanup temp surface!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue