replaced binary operations with a naive but faster implementation using a

2005-09-28  Sven Neumann  <sven@gimp.org>

	* app/paint-funcs/paint-funcs-generic.h (swap_pixels): replaced
	binary operations with a naive but faster implementation using a
	local variable.

	* app/composite/gimp-composite-generic.c
	(gimp_composite_swap_any_any_any_generic): same change here.
This commit is contained in:
Sven Neumann 2005-09-27 23:10:26 +00:00 committed by Sven Neumann
parent 8c9e9140c0
commit f478549bf1
2 changed files with 11 additions and 7 deletions

View File

@ -1,8 +1,11 @@
2005-09-28 Sven Neumann <sven@gimp.org>
* app/paint-funcs/paint-funcs-generic.h (swap_pixels): replaced
the binary XOR operations with a naive but faster implementation
using a local variable.
binary operations with a naive but faster implementation using a
local variable.
* app/composite/gimp-composite-generic.c
(gimp_composite_swap_any_any_any_generic): same change here.
2005-09-27 Sven Neumann <sven@gimp.org>

View File

@ -1318,17 +1318,18 @@ gimp_composite_replace_any_any_any_generic (GimpCompositeContext *ctx)
void
gimp_composite_swap_any_any_any_generic (GimpCompositeContext * ctx)
{
guint length;
guchar *src = ctx->A;
guchar *dest = ctx->B;
guint bytes1 = gimp_composite_pixel_bpp[ctx->pixelformat_A];
length = ctx->n_pixels * bytes1;
guint length = ctx->n_pixels * bytes1;
while (length--)
{
*src = *src ^ *dest;
*dest = *dest ^ *src;
*src = *src ^ *dest;
guchar tmp = *dest;
*dest = *src;
*src = tmp;
src++;
dest++;
}