pixman: Branch 'master' - 2 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Tue Jun 23 10:58:24 PDT 2009


 pixman/pixman-bits-image.c |   15 ++++++---------
 pixman/pixman-general.c    |    6 +++---
 pixman/pixman-private.h    |   13 +++++++------
 3 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit bb3b3da18ac6e1f935008fa50cd854b3de19afc3
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Tue Jun 23 13:44:48 2009 -0400

    Rename PIXMAN_FORMAT_16BPC macro to PIXMAN_FORMAT_IS_WIDE

diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c
index 3bd850a..9c11788 100644
--- a/pixman/pixman-general.c
+++ b/pixman/pixman-general.c
@@ -58,9 +58,9 @@ general_composite_rect  (pixman_implementation_t *imp,
     const pixman_format_code_t srcFormat = src->type == BITS ? src->bits.format : 0;
     const pixman_format_code_t maskFormat = mask && mask->type == BITS ? mask->bits.format : 0;
     const pixman_format_code_t destFormat = dest->type == BITS ? dest->bits.format : 0;
-    const int srcWide = PIXMAN_FORMAT_16BPC(srcFormat);
-    const int maskWide = mask && PIXMAN_FORMAT_16BPC(maskFormat);
-    const int destWide = PIXMAN_FORMAT_16BPC(destFormat);
+    const int srcWide = PIXMAN_FORMAT_IS_WIDE(srcFormat);
+    const int maskWide = mask && PIXMAN_FORMAT_IS_WIDE(maskFormat);
+    const int destWide = PIXMAN_FORMAT_IS_WIDE(destFormat);
     const int wide = srcWide || maskWide || destWide;
     const int Bpp = wide ? 8 : 4;
     uint8_t *scanline_buffer = stack_scanline_buffer;
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index a39b6c4..4f5931a 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -320,10 +320,6 @@ _pixman_gradient_walker_pixel (pixman_gradient_walker_t       *walker,
 	(t) = x + y,							\
 	(uint32_t) (uint8_t) ((t) | (0 - ((t) >> 8))))
 
-#define PIXMAN_FORMAT_16BPC(f)	(PIXMAN_FORMAT_A(f) > 8 || \
-				 PIXMAN_FORMAT_R(f) > 8 || \
-				 PIXMAN_FORMAT_G(f) > 8 || \
-				 PIXMAN_FORMAT_B(f) > 8)
 /*
  * Edges
  */
@@ -616,6 +612,8 @@ pixman_region16_copy_from_region32 (pixman_region16_t *dst,
 				    pixman_region32_t *src);
 
 
+/* Misc macros */
+
 #ifndef FALSE
 #   define FALSE 0
 #endif
@@ -650,6 +648,11 @@ pixman_region16_copy_from_region32 (pixman_region16_t *dst,
 			     ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
 			     ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
 
+#define PIXMAN_FORMAT_IS_WIDE(f)	(PIXMAN_FORMAT_A(f) > 8 || \
+					 PIXMAN_FORMAT_R(f) > 8 || \
+					 PIXMAN_FORMAT_G(f) > 8 || \
+					 PIXMAN_FORMAT_B(f) > 8)
+
 /*
  * Various debugging code
  */
commit 039d4618f79e384d93a7548466f80acae6da738c
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date:   Tue Jun 23 13:41:27 2009 -0400

    Write alpha map fetching with FbByteMul() instead of div_255()
    
    Delete the div_255/div_65535 macros.

diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 82a480b..797bf85 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -29,8 +29,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include "pixman-private.h"
+#include "pixman-combine32.h"
 
-#define Alpha(x) ((x) >> 24)
 #define Red(x) (((x) >> 16) & 0xff)
 #define Green(x) (((x) >> 8) & 0xff)
 #define Blue(x) ((x) & 0xff)
@@ -171,14 +171,11 @@ bits_image_fetch_alpha_pixels (bits_image_t *image, uint32_t *buffer, int n_pixe
 	for (j = 0; j < tmp_n_pixels; ++j)
 	{
 	    int a = alpha_pixels[j] >> 24;
-	    
-	    buffer[i] =
-		(a << 24)					|
-		div_255 (Red (buffer[2 * i - j]) * a) << 16	|
-		div_255 (Green (buffer[2 * i - j]) * a) << 8	|
-		div_255 (Blue (buffer[2 * i - j]) * a);
-	    
-	    i++;
+	    uint32_t p = buffer[2 * i - j] | 0xff000000;
+
+	    FbByteMul (p, a);
+
+	    buffer[i++] = p;
 	}
     }
 }
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 501139f..a39b6c4 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -319,8 +319,6 @@ _pixman_gradient_walker_pixel (pixman_gradient_walker_t       *walker,
 #define FbIntAdd(x,y,t) (						\
 	(t) = x + y,							\
 	(uint32_t) (uint8_t) ((t) | (0 - ((t) >> 8))))
-#define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8)
-#define div_65535(x) (((x) + 0x8000 + (((x) + 0x8000) >> 16)) >> 16)
 
 #define PIXMAN_FORMAT_16BPC(f)	(PIXMAN_FORMAT_A(f) > 8 || \
 				 PIXMAN_FORMAT_R(f) > 8 || \


More information about the xorg-commit mailing list