pixman: Branch 'master' - 2 commits

Søren Sandmann Pedersen sandmann at kemper.freedesktop.org
Wed Aug 25 15:54:32 PDT 2010


 configure.ac    |   14 ++++-
 pixman/pixman.c |  131 +++++++++++++++++++++++---------------------------------
 2 files changed, 66 insertions(+), 79 deletions(-)

New commits:
commit 5b99710042e812d294f571ad6d86fb003a8071e3
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Mon Aug 23 09:27:38 2010 -0400

    Be more paranoid about checking for GTK+
    
    From time to time people run into issues where the configure script
    detects GTK+ when it is either not installed, or not functional due to
    a missing pixman. Most recently:
    
      https://bugs.freedesktop.org/show_bug.cgi?id=29736
    
    This patch makes the configure script more paranoid by
    
    - always using PKG_CHECK_MODULES and not PKG_CHECK_EXISTS, since it
    seems PKG_CHECK_EXISTS will sometimes return true even if a dependency
    of GTK+, such as pixman-1, is missing.
    
    - explicitly checking that pixman-1 is installed before enabling GTK+.
    
    Cc: my.somewhat.lengthy.loginname at gmail.com

diff --git a/configure.ac b/configure.ac
index d8a8999..dbff2a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -178,7 +178,6 @@ AC_SUBST(PIXMAN_VERSION_MICRO)
 AC_SUBST(LT_VERSION_INFO)
 
 # Check for dependencies
-#PKG_CHECK_MODULES(DEP, x11)
 
 PIXMAN_CHECK_CFLAG([-Wall])
 PIXMAN_CHECK_CFLAG([-fno-strict-aliasing])
@@ -585,11 +584,18 @@ AC_ARG_ENABLE(gtk,
    [enable_gtk=$enableval], [enable_gtk=auto])
 
 PKG_PROG_PKG_CONFIG
+
+if test $enable_gtk = yes ; then
+   AC_CHECK_LIB([pixman-1], [pixman_version_string])
+   PKG_CHECK_MODULES(GTK, [gtk+-2.0 pixman-1])
+fi
+
 if test $enable_gtk = auto ; then
-   PKG_CHECK_EXISTS([gtk+-2.0], [enable_gtk=yes], [enable_gtk=no])
+   AC_CHECK_LIB([pixman-1], [pixman_version_string], [enable_gtk=auto], [enable_gtk=no])
 fi
-if test $enable_gtk = yes ; then
-   PKG_CHECK_MODULES(GTK, [gtk+-2.0])
+
+if test $enable_gtk = auto ; then
+   PKG_CHECK_MODULES(GTK, [gtk+-2.0 pixman-1], [enable_gtk=yes], [enable_gtk=no])
 fi
 
 AM_CONDITIONAL(HAVE_GTK, [test "x$enable_gtk" = xyes])
commit 5530bcab26508f38a25d2afffa7fef20f35a68e1
Author: Søren Sandmann Pedersen <ssp at redhat.com>
Date:   Sun Aug 22 11:09:45 2010 -0400

    Merge pixman_image_composite32() and do_composite().
    
    There is not much point having a separate function that just validates
    the images. Also add a boolean return to lookup_composite_function()
    so that we can return if no composite function is found.

diff --git a/pixman/pixman.c b/pixman/pixman.c
index ddd4935..402c72c 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -501,7 +501,7 @@ typedef struct
 
 PIXMAN_DEFINE_THREAD_LOCAL (cache_t, fast_path_cache);
 
-static force_inline void
+static force_inline pixman_bool_t
 lookup_composite_function (pixman_op_t			op,
 			   pixman_format_code_t		src_format,
 			   uint32_t			src_flags,
@@ -577,7 +577,7 @@ lookup_composite_function (pixman_op_t			op,
 	    ++info;
 	}
     }
-    return;
+    return FALSE;
 
 update_cache:
     if (i)
@@ -595,6 +595,8 @@ update_cache:
 	cache->cache[0].fast_path.dest_flags = dest_flags;
 	cache->cache[0].fast_path.func = *out_func;
     }
+
+    return TRUE;
 }
 
 static pixman_bool_t
@@ -803,19 +805,38 @@ analyze_extent (pixman_image_t *image, int x, int y,
     return TRUE;
 }
 
-static void
-do_composite (pixman_op_t	       op,
-	      pixman_image_t	      *src,
-	      pixman_image_t	      *mask,
-	      pixman_image_t	      *dest,
-	      int		       src_x,
-	      int		       src_y,
-	      int		       mask_x,
-	      int		       mask_y,
-	      int		       dest_x,
-	      int		       dest_y,
-	      int		       width,
-	      int		       height)
+/*
+ * Work around GCC bug causing crashes in Mozilla with SSE2
+ *
+ * When using -msse, gcc generates movdqa instructions assuming that
+ * the stack is 16 byte aligned. Unfortunately some applications, such
+ * as Mozilla and Mono, end up aligning the stack to 4 bytes, which
+ * causes the movdqa instructions to fail.
+ *
+ * The __force_align_arg_pointer__ makes gcc generate a prologue that
+ * realigns the stack pointer to 16 bytes.
+ *
+ * On x86-64 this is not necessary because the standard ABI already
+ * calls for a 16 byte aligned stack.
+ *
+ * See https://bugs.freedesktop.org/show_bug.cgi?id=15693
+ */
+#if defined (USE_SSE2) && defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
+__attribute__((__force_align_arg_pointer__))
+#endif
+PIXMAN_EXPORT void
+pixman_image_composite32 (pixman_op_t      op,
+                          pixman_image_t * src,
+                          pixman_image_t * mask,
+                          pixman_image_t * dest,
+                          int32_t          src_x,
+                          int32_t          src_y,
+                          int32_t          mask_x,
+                          int32_t          mask_y,
+                          int32_t          dest_x,
+                          int32_t          dest_y,
+                          int32_t          width,
+                          int32_t          height)
 {
     pixman_format_code_t src_format, mask_format, dest_format;
     uint32_t src_flags, mask_flags, dest_flags;
@@ -831,6 +852,11 @@ do_composite (pixman_op_t	       op,
     pixman_implementation_t *imp;
     pixman_composite_func_t func;
 
+    _pixman_image_validate (src);
+    if (mask)
+	_pixman_image_validate (mask);
+    _pixman_image_validate (dest);
+
     src_format = src->common.extended_format_code;
     src_flags = src->common.flags;
 
@@ -907,20 +933,21 @@ do_composite (pixman_op_t	       op,
     if (op == PIXMAN_OP_DST)
 	goto out;
 
-    lookup_composite_function (op,
-			       src_format, src_flags,
-			       mask_format, mask_flags,
-			       dest_format, dest_flags,
-			       &imp, &func);
-
-    walk_region_internal (imp, op,
-			  src, mask, dest,
-			  src_x, src_y, mask_x, mask_y,
-			  dest_x, dest_y,
-			  width, height,
-			  (src_flags & FAST_PATH_SIMPLE_REPEAT),
-			  (mask_flags & FAST_PATH_SIMPLE_REPEAT),
-			  &region, func);
+    if (lookup_composite_function (op,
+				   src_format, src_flags,
+				   mask_format, mask_flags,
+				   dest_format, dest_flags,
+				   &imp, &func))
+    {
+	walk_region_internal (imp, op,
+			      src, mask, dest,
+			      src_x, src_y, mask_x, mask_y,
+			      dest_x, dest_y,
+			      width, height,
+			      (src_flags & FAST_PATH_SIMPLE_REPEAT),
+			      (mask_flags & FAST_PATH_SIMPLE_REPEAT),
+			      &region, func);
+    }
 
 out:
     if (need_workaround)
@@ -951,52 +978,6 @@ pixman_image_composite (pixman_op_t      op,
                               mask_x, mask_y, dest_x, dest_y, width, height);
 }
 
-/*
- * Work around GCC bug causing crashes in Mozilla with SSE2
- *
- * When using -msse, gcc generates movdqa instructions assuming that
- * the stack is 16 byte aligned. Unfortunately some applications, such
- * as Mozilla and Mono, end up aligning the stack to 4 bytes, which
- * causes the movdqa instructions to fail.
- *
- * The __force_align_arg_pointer__ makes gcc generate a prologue that
- * realigns the stack pointer to 16 bytes.
- *
- * On x86-64 this is not necessary because the standard ABI already
- * calls for a 16 byte aligned stack.
- *
- * See https://bugs.freedesktop.org/show_bug.cgi?id=15693
- */
-#if defined (USE_SSE2) && defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
-__attribute__((__force_align_arg_pointer__))
-#endif
-PIXMAN_EXPORT void
-pixman_image_composite32 (pixman_op_t      op,
-                          pixman_image_t * src,
-                          pixman_image_t * mask,
-                          pixman_image_t * dest,
-                          int32_t          src_x,
-                          int32_t          src_y,
-                          int32_t          mask_x,
-                          int32_t          mask_y,
-                          int32_t          dest_x,
-                          int32_t          dest_y,
-                          int32_t          width,
-                          int32_t          height)
-{
-    _pixman_image_validate (src);
-    if (mask)
-	_pixman_image_validate (mask);
-    _pixman_image_validate (dest);
-
-    do_composite (op,
-		  src, mask, dest,
-		  src_x, src_y,
-		  mask_x, mask_y,
-		  dest_x, dest_y,
-		  width, height);
-}
-
 PIXMAN_EXPORT pixman_bool_t
 pixman_blt (uint32_t *src_bits,
             uint32_t *dst_bits,


More information about the xorg-commit mailing list