Author: tkreuzer
Date: Sat Mar 24 16:19:48 2012
New Revision: 56218
URL:
http://svn.reactos.org/svn/reactos?rev=56218&view=rev
Log:
[DIBLIB]
- Implement support for bottom up bitblt
- Add solid pattern support in generic BitBlt function
- Make sure right-to-left is only used in the appropriate functions
- Fix 1bpp _NextPixel() macro
Modified:
trunk/reactos/subsystems/win32/win32k/diblib/BitBlt.c
trunk/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCCOPY.c
trunk/reactos/subsystems/win32/win32k/diblib/DibLib.h
trunk/reactos/subsystems/win32/win32k/diblib/DibLib_AllSrcBPP.h
trunk/reactos/subsystems/win32/win32k/diblib/DibLib_BitBlt.h
trunk/reactos/subsystems/win32/win32k/diblib/DibLib_interface.h
Modified: trunk/reactos/subsystems/win32/win32k/diblib/BitBlt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/diblib/BitBlt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/diblib/BitBlt.c [iso-8859-1] Sat Mar 24 16:19:48
2012
@@ -6,9 +6,10 @@
#define __USES_DEST 1
#define __USES_MASK 0
+#define __FUNCTIONNAME BitBlt
+
#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[0](D,S,P)
-#define __FUNCTIONNAME BitBlt
#include "DibLib_AllSrcBPP.h"
#undef __FUNCTIONNAME
@@ -20,7 +21,17 @@
FASTCALL
Dib_BitBlt(PBLTDATA pBltData)
{
- gapfnBitBlt[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData);
+ /* Check for solid brush */
+ if (pBltData->ulSolidColor != 0xFFFFFFFF)
+ {
+ /* Use the solid version of PATCOPY! */
+
gapfnBitBlt_Solid[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData);
+ }
+ else
+ {
+ /* Use the pattern version */
+ gapfnBitBlt[pBltData->siDst.iFormat][pBltData->siSrc.iFormat](pBltData);
+ }
}
Modified: trunk/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCCOPY.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCCOPY.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/diblib/BitBlt_SRCCOPY.c [iso-8859-1] Sat Mar 24
16:19:48 2012
@@ -5,17 +5,20 @@
FASTCALL
Dib_BitBlt_SRCCOPY_EqSurf(PBLTDATA pBltData)
{
- ULONG cLines, cjWidth = pBltData->ulWidth * pBltData->jDstBpp;
+ ULONG cLines, cjWidth;
PBYTE pjDestBase = pBltData->siDst.pjBase;
PBYTE pjSrcBase = pBltData->siSrc.pjBase;
+
+ /* Calculate the width in bytes */
+ cjWidth = pBltData->ulWidth * pBltData->siDst.jBpp / 8;
/* Loop all lines */
cLines = pBltData->ulHeight;
while (cLines--)
{
memcpy(pjDestBase, pjSrcBase, cjWidth);
- pjDestBase += pBltData->siDst.lDelta;
- pjSrcBase += pBltData->siSrc.lDelta;
+ pjDestBase += pBltData->siDst.cjAdvanceY;
+ pjSrcBase += pBltData->siSrc.cjAdvanceY;
}
}
@@ -38,8 +41,8 @@
while (cLines--)
{
__movsd((PULONG)pjDestBase, (PULONG)pjSrcBase, cRows);
- pjDestBase += pBltData->siDst.lDelta;
- pjSrcBase += pBltData->siSrc.lDelta;
+ pjDestBase += pBltData->siDst.cjAdvanceY;
+ pjSrcBase += pBltData->siSrc.cjAdvanceY;
}
}
#else
Modified: trunk/reactos/subsystems/win32/win32k/diblib/DibLib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/diblib/DibLib.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/diblib/DibLib.h [iso-8859-1] Sat Mar 24 16:19:48
2012
@@ -42,8 +42,8 @@
#define _ReadPixel_1(pjSource, jShift) (((*(pjSource)) >> (jShift)) & 1)
#define _WritePixel_1(pjDest, jShift, ulColor) (void)(*(pjDest) = (UCHAR)((*(pjDest)
& ~(1<<(jShift))) | ((ulColor)<<(jShift))))
-#define _NextPixel_1(ppj, pjShift) (void)((*(pjShift))--, *(pjShift) &= 7, (*(ppj) +=
(*(pjShift) >> 5)))
-#define _NextPixelR2L_1(ppj, pjShift) (void)((*(ppj) -= (*(pjShift) >> 5)),
(*(pjShift))++, *(pjShift) &= 7)
+#define _NextPixel_1(ppj, pjShift) (void)(((*(pjShift))--), (*(pjShift) &= 7),
(*(ppj) += (*(pjShift) == 7)))
+#define _NextPixelR2L_1(ppj, pjShift) (void)(((*(pjShift))++), (*(pjShift) &= 7),
(*(ppj) -= (*(pjShift) == 0)))
#define _SHIFT_1(x) x
#define _CALCSHIFT_1(pShift, x) (void)(*(pShift) = (7 - ((x) & 7)))
Modified: trunk/reactos/subsystems/win32/win32k/diblib/DibLib_AllSrcBPP.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/diblib/DibLib_AllSrcBPP.h [iso-8859-1]
(original)
+++ trunk/reactos/subsystems/win32/win32k/diblib/DibLib_AllSrcBPP.h [iso-8859-1] Sat Mar
24 16:19:48 2012
@@ -30,16 +30,17 @@
#undef _DibXlate
#define _DibXlate(pBltData, ulColor) (ulColor)
#define _SOURCE_BPP _DEST_BPP
-#define _NextPixel_ _NextPixelR2L_
#undef __DIB_FUNCTION_NAME
#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_SRCDSTEQ
#include "diblib_alldstbpp.h"
+#define _NextPixel_ _NextPixelR2L_
#undef __DIB_FUNCTION_NAME
#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_SRCDSTEQR2L
#include "diblib_alldstbpp.h"
#undef _SOURCE_BPP
+#undef _NextPixel_
PFN_DIBFUNCTION
__PASTE(gapfn, __FUNCTIONNAME)[7][7] =
Modified: trunk/reactos/subsystems/win32/win32k/diblib/DibLib_BitBlt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/diblib/DibLib_BitBlt.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/diblib/DibLib_BitBlt.h [iso-8859-1] Sat Mar 24
16:19:48 2012
@@ -77,7 +77,7 @@
#if __USES_MASK
/* Read the mask color and go to the next mask pixel */
jMaskBit = _ReadPixel_1(pjMask, jMskShift);
- _NextPixel_1(&pjMask, &jMskShift);
+ _NextPixel(1, &pjMask, &jMskShift);
#endif
#if __USES_PATTERN
/* Read the pattern color and go to the next pattern pixel */
@@ -110,13 +110,13 @@
_NextPixel(_DEST_BPP, &pjDest, &jDstShift);
}
- pjDestBase += pBltData->siDst.lDelta;
+ pjDestBase += pBltData->siDst.cjAdvanceY;
#if __USES_SOURCE
- pjSrcBase += pBltData->siSrc.lDelta;
+ pjSrcBase += pBltData->siSrc.cjAdvanceY;
#endif
#if __USES_PATTERN
/* Go to the next pattern line */
- pjPatBase += pBltData->siPat.lDelta;
+ pjPatBase += pBltData->siPat.cjAdvanceY;
/* Check if this was the last line in the pattern */
if (--cPatLines == 0)
Modified: trunk/reactos/subsystems/win32/win32k/diblib/DibLib_interface.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/diblib/DibLib_interface.h [iso-8859-1]
(original)
+++ trunk/reactos/subsystems/win32/win32k/diblib/DibLib_interface.h [iso-8859-1] Sat Mar
24 16:19:48 2012
@@ -7,6 +7,7 @@
PBYTE pvScan0;
PBYTE pjBase;
LONG lDelta;
+ LONG cjAdvanceY;
POINTL ptOrig;
BYTE jBpp;
} SURFINFO;
@@ -27,7 +28,7 @@
ULONG rop4;
PFN_DOROP apfnDoRop[2];
ULONG ulSolidColor;
- BYTE jDstBpp;
+ LONG dy;
} BLTDATA, *PBLTDATA;
typedef