mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:15:59 +00:00
[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 svn path=/trunk/; revision=56218
This commit is contained in:
parent
a173e25d87
commit
720cab7b58
6 changed files with 31 additions and 15 deletions
|
@ -6,9 +6,10 @@
|
||||||
#define __USES_DEST 1
|
#define __USES_DEST 1
|
||||||
#define __USES_MASK 0
|
#define __USES_MASK 0
|
||||||
|
|
||||||
|
#define __FUNCTIONNAME BitBlt
|
||||||
|
|
||||||
#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[0](D,S,P)
|
#define _DibDoRop(pBltData, M, D, S, P) pBltData->apfnDoRop[0](D,S,P)
|
||||||
|
|
||||||
#define __FUNCTIONNAME BitBlt
|
|
||||||
#include "DibLib_AllSrcBPP.h"
|
#include "DibLib_AllSrcBPP.h"
|
||||||
|
|
||||||
#undef __FUNCTIONNAME
|
#undef __FUNCTIONNAME
|
||||||
|
@ -20,7 +21,17 @@ VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
Dib_BitBlt(PBLTDATA pBltData)
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,17 +5,20 @@ VOID
|
||||||
FASTCALL
|
FASTCALL
|
||||||
Dib_BitBlt_SRCCOPY_EqSurf(PBLTDATA pBltData)
|
Dib_BitBlt_SRCCOPY_EqSurf(PBLTDATA pBltData)
|
||||||
{
|
{
|
||||||
ULONG cLines, cjWidth = pBltData->ulWidth * pBltData->jDstBpp;
|
ULONG cLines, cjWidth;
|
||||||
PBYTE pjDestBase = pBltData->siDst.pjBase;
|
PBYTE pjDestBase = pBltData->siDst.pjBase;
|
||||||
PBYTE pjSrcBase = pBltData->siSrc.pjBase;
|
PBYTE pjSrcBase = pBltData->siSrc.pjBase;
|
||||||
|
|
||||||
|
/* Calculate the width in bytes */
|
||||||
|
cjWidth = pBltData->ulWidth * pBltData->siDst.jBpp / 8;
|
||||||
|
|
||||||
/* Loop all lines */
|
/* Loop all lines */
|
||||||
cLines = pBltData->ulHeight;
|
cLines = pBltData->ulHeight;
|
||||||
while (cLines--)
|
while (cLines--)
|
||||||
{
|
{
|
||||||
memcpy(pjDestBase, pjSrcBase, cjWidth);
|
memcpy(pjDestBase, pjSrcBase, cjWidth);
|
||||||
pjDestBase += pBltData->siDst.lDelta;
|
pjDestBase += pBltData->siDst.cjAdvanceY;
|
||||||
pjSrcBase += pBltData->siSrc.lDelta;
|
pjSrcBase += pBltData->siSrc.cjAdvanceY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,8 +41,8 @@ Dib_BitBlt_SRCCOPY_S32_D32_EqSurf(PBLTDATA pBltData)
|
||||||
while (cLines--)
|
while (cLines--)
|
||||||
{
|
{
|
||||||
__movsd((PULONG)pjDestBase, (PULONG)pjSrcBase, cRows);
|
__movsd((PULONG)pjDestBase, (PULONG)pjSrcBase, cRows);
|
||||||
pjDestBase += pBltData->siDst.lDelta;
|
pjDestBase += pBltData->siDst.cjAdvanceY;
|
||||||
pjSrcBase += pBltData->siSrc.lDelta;
|
pjSrcBase += pBltData->siSrc.cjAdvanceY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -42,8 +42,8 @@ extern const BYTE ajShift4[2];
|
||||||
|
|
||||||
#define _ReadPixel_1(pjSource, jShift) (((*(pjSource)) >> (jShift)) & 1)
|
#define _ReadPixel_1(pjSource, jShift) (((*(pjSource)) >> (jShift)) & 1)
|
||||||
#define _WritePixel_1(pjDest, jShift, ulColor) (void)(*(pjDest) = (UCHAR)((*(pjDest) & ~(1<<(jShift))) | ((ulColor)<<(jShift))))
|
#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 _NextPixel_1(ppj, pjShift) (void)(((*(pjShift))--), (*(pjShift) &= 7), (*(ppj) += (*(pjShift) == 7)))
|
||||||
#define _NextPixelR2L_1(ppj, pjShift) (void)((*(ppj) -= (*(pjShift) >> 5)), (*(pjShift))++, *(pjShift) &= 7)
|
#define _NextPixelR2L_1(ppj, pjShift) (void)(((*(pjShift))++), (*(pjShift) &= 7), (*(ppj) -= (*(pjShift) == 0)))
|
||||||
#define _SHIFT_1(x) x
|
#define _SHIFT_1(x) x
|
||||||
#define _CALCSHIFT_1(pShift, x) (void)(*(pShift) = (7 - ((x) & 7)))
|
#define _CALCSHIFT_1(pShift, x) (void)(*(pShift) = (7 - ((x) & 7)))
|
||||||
|
|
||||||
|
|
|
@ -30,16 +30,17 @@
|
||||||
#undef _DibXlate
|
#undef _DibXlate
|
||||||
#define _DibXlate(pBltData, ulColor) (ulColor)
|
#define _DibXlate(pBltData, ulColor) (ulColor)
|
||||||
#define _SOURCE_BPP _DEST_BPP
|
#define _SOURCE_BPP _DEST_BPP
|
||||||
#define _NextPixel_ _NextPixelR2L_
|
|
||||||
|
|
||||||
#undef __DIB_FUNCTION_NAME
|
#undef __DIB_FUNCTION_NAME
|
||||||
#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_SRCDSTEQ
|
#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_SRCDSTEQ
|
||||||
#include "diblib_alldstbpp.h"
|
#include "diblib_alldstbpp.h"
|
||||||
|
|
||||||
|
#define _NextPixel_ _NextPixelR2L_
|
||||||
#undef __DIB_FUNCTION_NAME
|
#undef __DIB_FUNCTION_NAME
|
||||||
#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_SRCDSTEQR2L
|
#define __DIB_FUNCTION_NAME __DIB_FUNCTION_NAME_SRCDSTEQR2L
|
||||||
#include "diblib_alldstbpp.h"
|
#include "diblib_alldstbpp.h"
|
||||||
#undef _SOURCE_BPP
|
#undef _SOURCE_BPP
|
||||||
|
#undef _NextPixel_
|
||||||
|
|
||||||
PFN_DIBFUNCTION
|
PFN_DIBFUNCTION
|
||||||
__PASTE(gapfn, __FUNCTIONNAME)[7][7] =
|
__PASTE(gapfn, __FUNCTIONNAME)[7][7] =
|
||||||
|
|
|
@ -77,7 +77,7 @@ _DibFunction(PBLTDATA pBltData)
|
||||||
#if __USES_MASK
|
#if __USES_MASK
|
||||||
/* Read the mask color and go to the next mask pixel */
|
/* Read the mask color and go to the next mask pixel */
|
||||||
jMaskBit = _ReadPixel_1(pjMask, jMskShift);
|
jMaskBit = _ReadPixel_1(pjMask, jMskShift);
|
||||||
_NextPixel_1(&pjMask, &jMskShift);
|
_NextPixel(1, &pjMask, &jMskShift);
|
||||||
#endif
|
#endif
|
||||||
#if __USES_PATTERN
|
#if __USES_PATTERN
|
||||||
/* Read the pattern color and go to the next pattern pixel */
|
/* Read the pattern color and go to the next pattern pixel */
|
||||||
|
@ -110,13 +110,13 @@ _DibFunction(PBLTDATA pBltData)
|
||||||
_NextPixel(_DEST_BPP, &pjDest, &jDstShift);
|
_NextPixel(_DEST_BPP, &pjDest, &jDstShift);
|
||||||
}
|
}
|
||||||
|
|
||||||
pjDestBase += pBltData->siDst.lDelta;
|
pjDestBase += pBltData->siDst.cjAdvanceY;
|
||||||
#if __USES_SOURCE
|
#if __USES_SOURCE
|
||||||
pjSrcBase += pBltData->siSrc.lDelta;
|
pjSrcBase += pBltData->siSrc.cjAdvanceY;
|
||||||
#endif
|
#endif
|
||||||
#if __USES_PATTERN
|
#if __USES_PATTERN
|
||||||
/* Go to the next pattern line */
|
/* Go to the next pattern line */
|
||||||
pjPatBase += pBltData->siPat.lDelta;
|
pjPatBase += pBltData->siPat.cjAdvanceY;
|
||||||
|
|
||||||
/* Check if this was the last line in the pattern */
|
/* Check if this was the last line in the pattern */
|
||||||
if (--cPatLines == 0)
|
if (--cPatLines == 0)
|
||||||
|
|
|
@ -7,6 +7,7 @@ typedef struct
|
||||||
PBYTE pvScan0;
|
PBYTE pvScan0;
|
||||||
PBYTE pjBase;
|
PBYTE pjBase;
|
||||||
LONG lDelta;
|
LONG lDelta;
|
||||||
|
LONG cjAdvanceY;
|
||||||
POINTL ptOrig;
|
POINTL ptOrig;
|
||||||
BYTE jBpp;
|
BYTE jBpp;
|
||||||
} SURFINFO;
|
} SURFINFO;
|
||||||
|
@ -27,7 +28,7 @@ typedef struct
|
||||||
ULONG rop4;
|
ULONG rop4;
|
||||||
PFN_DOROP apfnDoRop[2];
|
PFN_DOROP apfnDoRop[2];
|
||||||
ULONG ulSolidColor;
|
ULONG ulSolidColor;
|
||||||
BYTE jDstBpp;
|
LONG dy;
|
||||||
} BLTDATA, *PBLTDATA;
|
} BLTDATA, *PBLTDATA;
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue