mirror of
https://github.com/reactos/reactos.git
synced 2025-08-10 07:03:02 +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 */
|
/* optimze functions for bitblt */
|
||||||
BOOLEAN
|
VOID
|
||||||
|
FASTCALL
|
||||||
DIB_32DstInvert(PBLTINFO BltInfo)
|
DIB_32DstInvert(PBLTINFO BltInfo)
|
||||||
{
|
{
|
||||||
// return(~Dest);
|
|
||||||
ULONG DestX, DestY;
|
|
||||||
ULONG Dest;
|
|
||||||
PULONG DestBits;
|
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;
|
/* Calculate the Initial Destination */
|
||||||
ULONG right = BltInfo->DestRect.right;
|
DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 + (left << 2) +
|
||||||
ULONG delta = BltInfo->DestSurface->lDelta - ((BltInfo->DestRect.right - BltInfo->DestRect.left) <<2) ;
|
top * BltInfo->DestSurface->lDelta);
|
||||||
|
|
||||||
DestBits = (PULONG)(BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.left << 2) +
|
do while (DestY > 0)
|
||||||
BltInfo->DestRect.top * BltInfo->DestSurface->lDelta);
|
{
|
||||||
|
do while (DestX > 0)
|
||||||
for (DestY = BltInfo->DestRect.top; DestY < bottom; DestY++)
|
{
|
||||||
{
|
/* Invert bits */
|
||||||
for (DestX = BltInfo->DestRect.left; DestX < right; DestX++, DestBits++)
|
*DestBits =~ *DestBits;
|
||||||
{
|
|
||||||
Dest = *DestBits;
|
/* Update Position */
|
||||||
*DestBits = ~Dest;
|
DestBits++;
|
||||||
}
|
|
||||||
|
/* Decrease distance to do */
|
||||||
|
DestX--;
|
||||||
|
}
|
||||||
|
|
||||||
DestBits = (PULONG)((ULONG_PTR)DestBits + delta);
|
/* Update position */
|
||||||
|
DestBits = (PULONG)((ULONG_PTR)DestBits + delta);
|
||||||
|
|
||||||
|
/* Decrease distance to do */
|
||||||
|
DestY--;
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue