Optimized DstInvert32 Modified: trunk/reactos/subsys/win32k/dib/dib32bpp.c _____
Modified: trunk/reactos/subsys/win32k/dib/dib32bpp.c --- trunk/reactos/subsys/win32k/dib/dib32bpp.c 2005-06-04 10:05:20 UTC (rev 15768) +++ trunk/reactos/subsys/win32k/dib/dib32bpp.c 2005-06-04 13:20:34 UTC (rev 15769) @@ -398,32 +398,41 @@
}
/* 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); - - for (DestY = BltInfo->DestRect.top; DestY < bottom; DestY++) - { - for (DestX = BltInfo->DestRect.left; DestX < right; DestX++, DestBits++) - { - Dest = *DestBits; - *DestBits = ~Dest; - } + do while (DestY > 0) + { + do while (DestX > 0) + { + /* Invert bits */ + *DestBits =~ *DestBits; + + /* Update Position */ + 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