Commit f478549b authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

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.
parent 8c9e9140
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>
......
......@@ -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++;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment