From 06aed5243730662a3a0d2cae92e1a692db928f78 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Tue, 28 Mar 2000 04:49:42 +0000 Subject: [PATCH] Fix problem with precendence of >> and & which was keeping composite_color 2000-03-27 Owen Taylor * gdk-pixbuf/pixops/pixops.c: Fix problem with precendence of >> and & which was keeping composite_color from working with non-gray images. --- gdk-pixbuf/ChangeLog | 6 ++++++ gdk-pixbuf/pixops/pixops.c | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 9f91418a8e..1748b9d4ca 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,9 @@ +2000-03-27 Owen Taylor + + * gdk-pixbuf/pixops/pixops.c: Fix problem with + precendence of >> and & which was keeping composite_color + from working with non-gray images. + 2000-03-08 Jonathan Blandford * gdk-pixbuf/io-gif.c (gdk_pixbuf__gif_image_load): free the context. diff --git a/gdk-pixbuf/pixops/pixops.c b/gdk-pixbuf/pixops/pixops.c index 80246505de..78bf44eda6 100644 --- a/gdk-pixbuf/pixops/pixops.c +++ b/gdk-pixbuf/pixops/pixops.c @@ -249,22 +249,22 @@ pixops_composite_color_nearest (art_u8 *dest_buf, if (((i + check_y) >> check_shift) & 1) { - r1 = color2 & 0xff0000 >> 16; - g1 = color2 & 0xff00 >> 8; + r1 = (color2 & 0xff0000) >> 16; + g1 = (color2 & 0xff00) >> 8; b1 = color2 & 0xff; - r2 = color1 & 0xff0000 >> 16; - g2 = color1 & 0xff00 >> 8; + r2 = (color1 & 0xff0000) >> 16; + g2 = (color1 & 0xff00) >> 8; b2 = color1 & 0xff; } else { - r1 = color1 & 0xff0000 >> 16; - g1 = color1 & 0xff00 >> 8; + r1 = (color1 & 0xff0000) >> 16; + g1 = (color1 & 0xff00) >> 8; b1 = color1 & 0xff; - r2 = color2 & 0xff0000 >> 16; - g2 = color2 & 0xff00 >> 8; + r2 = (color2 & 0xff0000) >> 16; + g2 = (color2 & 0xff00) >> 8; b2 = color2 & 0xff; } @@ -512,14 +512,14 @@ composite_pixel_color (art_u8 *dest, int dest_x, int dest_channels, int dest_has if ((dest_x >> check_shift) & 1) { - dest_r = color2 & 0xff0000 >> 16; - dest_g = color2 & 0xff00 >> 8; + dest_r = (color2 & 0xff0000) >> 16; + dest_g = (color2 & 0xff00) >> 8; dest_b = color2 & 0xff; } else { - dest_r = color1 & 0xff0000 >> 16; - dest_g = color1 & 0xff00 >> 8; + dest_r = (color1 & 0xff0000) >> 16; + dest_g = (color1 & 0xff00) >> 8; dest_b = color1 & 0xff; } @@ -548,12 +548,12 @@ composite_line_color (int *weights, int n_x, int n_y, g_return_val_if_fail (check_size != 0, dest); - dest_r1 = color1 & 0xff0000 >> 16; - dest_g1 = color1 & 0xff00 >> 8; + dest_r1 = (color1 & 0xff0000) >> 16; + dest_g1 = (color1 & 0xff00) >> 8; dest_b1 = color1 & 0xff; - dest_r2 = color2 & 0xff0000 >> 16; - dest_g2 = color2 & 0xff00 >> 8; + dest_r2 = (color2 & 0xff0000) >> 16; + dest_g2 = (color2 & 0xff00) >> 8; dest_b2 = color2 & 0xff; while (dest < dest_end)