Author: tkreuzer
Date: Sat Apr 21 21:00:08 2012
New Revision: 56388
URL:
http://svn.reactos.org/svn/reactos?rev=56388&view=rev
Log:
[DIBLIB]
Fix calculation of pattern pointer
[WIN32K]
Fix (almost) calculation of pattern origin. There's still a bugger left.
Modified:
trunk/reactos/win32ss/gdi/diblib/DibLib_BitBlt.h
trunk/reactos/win32ss/gdi/eng/bitblt_new.c
Modified: trunk/reactos/win32ss/gdi/diblib/DibLib_BitBlt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/diblib/DibLib_…
==============================================================================
--- trunk/reactos/win32ss/gdi/diblib/DibLib_BitBlt.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/diblib/DibLib_BitBlt.h [iso-8859-1] Sat Apr 21 21:00:08
2012
@@ -44,10 +44,7 @@
#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
@@ -68,6 +65,11 @@
#if __USES_MASK
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 */
Modified: trunk/reactos/win32ss/gdi/eng/bitblt_new.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/bitblt_new…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] Sat Apr 21 21:00:08 2012
@@ -72,10 +72,22 @@
{
/* 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 @@
{
BOOL bResult;
RECTL rcClipped;
- POINTL ptOffset, ptSrc, ptMask;
+ POINTL ptOffset, ptSrc, ptMask, ptBrush;
SIZEL sizTrg;
PFN_DrvBitBlt pfnBitBlt;
@@ -460,6 +472,14 @@
ptSrc.y += ptOffset.y;
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;
@@ -499,7 +519,7 @@
psoSrc ? &ptSrc : NULL,
psoMask ? &ptMask : NULL,
pbo,
- pptlBrush,
+ pptlBrush ? &ptBrush : NULL,
rop4);
// FIXME: cleanup temp surface!