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:
Timo Kreuzer 2012-04-21 21:00:08 +00:00
parent e3411f18ca
commit 85b693d42d
2 changed files with 30 additions and 8 deletions

View file

@ -44,10 +44,7 @@ _DibFunction(PBLTDATA pBltData)
#if __USES_PATTERN
pjPatBase = pBltData->siPat.pjBase;
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;
cPatRows = pBltData->ulPatWidth - pBltData->siPat.ptOrig.x;
#endif
pjDestBase = pBltData->siDst.pjBase;
#if __USES_SOURCE
@ -69,6 +66,11 @@ _DibFunction(PBLTDATA pBltData)
pjMask = pjMaskBase;
_CALCSHIFT_1(&jMskShift, pBltData->siMsk.ptOrig.x);
#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 */
cRows = pBltData->ulWidth;

View file

@ -72,10 +72,22 @@ CalculateCoordinates(
{
/* Calculate start point and bitpointer for pattern */
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.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;
RECTL rcClipped;
POINTL ptOffset, ptSrc, ptMask;
POINTL ptOffset, ptSrc, ptMask, ptBrush;
SIZEL sizTrg;
PFN_DrvBitBlt pfnBitBlt;
@ -461,6 +473,14 @@ IntEngBitBlt(
ptMask.x += ptOffset.x;
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 */
rcClipped.left = prclTrg->left + ptOffset.x;
rcClipped.top = prclTrg->top + ptOffset.y;
@ -499,7 +519,7 @@ IntEngBitBlt(
psoSrc ? &ptSrc : NULL,
psoMask ? &ptMask : NULL,
pbo,
pptlBrush,
pptlBrush ? &ptBrush : NULL,
rop4);
// FIXME: cleanup temp surface!