mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Optimized DstInvert32
svn path=/trunk/; revision=15769
This commit is contained in:
parent
e13bb66f6e
commit
e24313d28a
1 changed files with 28 additions and 19 deletions
|
@ -398,32 +398,41 @@ DIB_32BPP_BitBlt(PBLTINFO BltInfo)
|
|||
}
|
||||
|
||||
/* optimze functions for bitblt */
|
||||
BOOLEAN
|
||||
VOID
|
||||
FASTCALL
|
||||
DIB_32DstInvert(PBLTINFO BltInfo)
|
||||
{
|
||||
// return(~Dest);
|
||||
ULONG DestX, DestY;
|
||||
ULONG Dest;
|
||||
PULONG DestBits;
|
||||
ULONG top = BltInfo->DestRect.top;
|
||||
ULONG bottom = BltInfo->DestRect.left;
|
||||
ULONG DestX = BltInfo->DestRect.right - left;
|
||||
ULONG DestY = BltInfo->DestRect.bottom - top;
|
||||
ULONG delta = BltInfo->DestSurface->lDelta - (DestX << 2);
|
||||
|
||||
ULONG bottom = BltInfo->DestRect.bottom;
|
||||
ULONG right = BltInfo->DestRect.right;
|
||||
ULONG delta = BltInfo->DestSurface->lDelta - ((BltInfo->DestRect.right - BltInfo->DestRect.left) <<2) ;
|
||||
/* Calculate the Initial Destination */
|
||||
DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 + (left << 2) +
|
||||
top * BltInfo->DestSurface->lDelta);
|
||||
|
||||
DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.left << 2) +
|
||||
BltInfo->DestRect.top * BltInfo->DestSurface->lDelta);
|
||||
do while (DestY > 0)
|
||||
{
|
||||
do while (DestX > 0)
|
||||
{
|
||||
/* Invert bits */
|
||||
*DestBits =~ *DestBits;
|
||||
|
||||
for (DestY = BltInfo->DestRect.top; DestY < bottom; DestY++)
|
||||
{
|
||||
for (DestX = BltInfo->DestRect.left; DestX < right; DestX++, DestBits++)
|
||||
{
|
||||
Dest = *DestBits;
|
||||
*DestBits = ~Dest;
|
||||
}
|
||||
/* Update Position */
|
||||
DestBits++;
|
||||
|
||||
DestBits = (PULONG)((ULONG_PTR)DestBits + delta);
|
||||
/* Decrease distance to do */
|
||||
DestX--;
|
||||
}
|
||||
|
||||
/* Update position */
|
||||
DestBits = (PULONG)((ULONG_PTR)DestBits + delta);
|
||||
|
||||
/* Decrease distance to do */
|
||||
DestY--;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
|
|
Loading…
Reference in a new issue