pixman: Branch 'master' - 3 commits

Benjamin Otte company at kemper.freedesktop.org
Mon Oct 19 15:48:59 PDT 2009


 autogen.sh                 |    2 +-
 pixman/pixman-bits-image.c |    6 ++++++
 pixman/pixman-edge.c       |    3 +++
 pixman/pixman-fast-path.c  |    2 ++
 pixman/pixman-image.c      |    4 ++++
 pixman/pixman-mmx.c        |    2 ++
 test/alpha-test.c          |   10 +++++-----
 test/blitters-test.c       |    3 ++-
 test/clip-test.c           |    2 ++
 test/composite-test.c      |    5 ++++-
 test/composite.c           |   18 ++++++++++++++++++
 test/gradient-test.c       |    8 +++++---
 test/scaling-test.c        |    3 +++
 test/utils.h               |    7 +++++++
 14 files changed, 64 insertions(+), 11 deletions(-)

New commits:
commit 9bcfc0ac547277d3a3f4e5ff0922450566ad8be8
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Sep 30 08:02:39 2009 +0200

    --enable-maintainer-mode is gone from configure, so remove it

diff --git a/autogen.sh b/autogen.sh
index 904cd67..354f254 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -9,4 +9,4 @@ cd $srcdir
 autoreconf -v --install || exit 1
 cd $ORIGDIR || exit $?
 
-$srcdir/configure --enable-maintainer-mode "$@"
+$srcdir/configure "$@"
commit fa49ef81f7b39d32b626ed235958448835e2d2c2
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Sep 17 13:19:04 2009 +0200

    Add default cases for all switch statements
    
    Fixes compilation with -Wswitch-default. Compilation with -Wswitch-enums
    works fine as is.

diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 4e78ce1..9e93623 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -157,6 +157,9 @@ repeat (pixman_repeat_t repeat, int size, int *coord)
 
     case PIXMAN_REPEAT_NONE:
 	break;
+
+    default:
+        break;
     }
 }
 
@@ -339,6 +342,9 @@ bits_image_fetch_pixel_filtered (bits_image_t *image,
     case PIXMAN_FILTER_CONVOLUTION:
 	return bits_image_fetch_pixel_convolution (image, x, y);
 	break;
+
+    default:
+        break;
     }
 
     return 0;
diff --git a/pixman/pixman-edge.c b/pixman/pixman-edge.c
index 81a2e96..ab9bea0 100644
--- a/pixman/pixman-edge.c
+++ b/pixman/pixman-edge.c
@@ -358,6 +358,9 @@ PIXMAN_RASTERIZE_EDGES (pixman_image_t *image,
     case 8:
 	rasterize_edges_8 (image, l, r, t, b);
 	break;
+
+    default:
+        break;
     }
 }
 
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index bba5fd6..59db840 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -593,6 +593,10 @@ _pixman_image_is_opaque (pixman_image_t *image)
 	if (ALPHA_8 (image->solid.color) != 0xff)
 	    return FALSE;
 	break;
+
+    default:
+        return FALSE;
+        break;
     }
 
     /* Convolution filters can introduce translucency if the sum of the
diff --git a/test/composite.c b/test/composite.c
index 7996251..594e8cc 100644
--- a/test/composite.c
+++ b/test/composite.c
@@ -407,6 +407,22 @@ calc_op (pixman_op_t op, double src, double dst, double srca, double dsta)
 	    Fb = max (0.0, 1.0 - srca / dsta);
 	return mult_chan (src, dst, Fa, Fb);
 
+    case PIXMAN_OP_MULTIPLY:
+    case PIXMAN_OP_SCREEN:
+    case PIXMAN_OP_OVERLAY:
+    case PIXMAN_OP_DARKEN:
+    case PIXMAN_OP_LIGHTEN:
+    case PIXMAN_OP_COLOR_DODGE:
+    case PIXMAN_OP_COLOR_BURN:
+    case PIXMAN_OP_HARD_LIGHT:
+    case PIXMAN_OP_SOFT_LIGHT:
+    case PIXMAN_OP_DIFFERENCE:
+    case PIXMAN_OP_EXCLUSION:
+    case PIXMAN_OP_HSL_HUE:
+    case PIXMAN_OP_HSL_SATURATION:
+    case PIXMAN_OP_HSL_COLOR:
+    case PIXMAN_OP_HSL_LUMINOSITY:
+    case PIXMAN_OP_NONE:
     default:
 	abort();
     }
@@ -866,6 +882,8 @@ main (void)
 			    ok = composite_test (&dst, op, &src, &mask,
 						 mask.size? TRUE : FALSE);
 			    break;
+                        default:
+                            break;
 			}
 			group_ok = group_ok && ok;
 			tests_passed += ok;
diff --git a/test/scaling-test.c b/test/scaling-test.c
index 8899c59..c158c23 100644
--- a/test/scaling-test.c
+++ b/test/scaling-test.c
@@ -326,6 +326,9 @@ test_composite (uint32_t initcrc,
     case 3:
 	repeat = PIXMAN_REPEAT_REFLECT;
 	break;
+
+    default:
+        break;
     }
     pixman_image_set_repeat (src_img, repeat);
 
commit 5c3ef4e9798f3395c55fe7b57df32f77c0de2c71
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Sep 17 13:18:22 2009 +0200

    Fix compile warnings

diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index 25f6016..c053229 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -723,6 +723,7 @@ fast_composite_over_8888_8888 (pixman_implementation_t *imp,
     }
 }
 
+#if 0
 static void
 fast_composite_over_8888_0888 (pixman_implementation_t *imp,
 			       pixman_op_t              op,
@@ -773,6 +774,7 @@ fast_composite_over_8888_0888 (pixman_implementation_t *imp,
 	}
     }
 }
+#endif
 
 static void
 fast_composite_over_8888_0565 (pixman_implementation_t *imp,
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 3595742..aaddff5 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3153,6 +3153,7 @@ mmx_composite_copy_area (pixman_implementation_t *imp,
                     src_x, src_y, dest_x, dest_y, width, height);
 }
 
+#if 0
 static void
 mmx_composite_over_x888_8_8888 (pixman_implementation_t *imp,
                                 pixman_op_t              op,
@@ -3219,6 +3220,7 @@ mmx_composite_over_x888_8_8888 (pixman_implementation_t *imp,
 
     _mm_empty ();
 }
+#endif
 
 static const pixman_fast_path_t mmx_fast_paths[] =
 {
diff --git a/test/alpha-test.c b/test/alpha-test.c
index e2b97c7..fd6b2ec 100644
--- a/test/alpha-test.c
+++ b/test/alpha-test.c
@@ -14,7 +14,6 @@ main (int argc, char **argv)
     uint32_t *src = malloc (WIDTH * HEIGHT * 4);
     pixman_image_t *grad_img;
     pixman_image_t *alpha_img;
-    pixman_image_t *solid_img;
     pixman_image_t *dest_img;
     pixman_image_t *src_img;
     int i;
@@ -26,24 +25,25 @@ main (int argc, char **argv)
     pixman_point_fixed_t p1 = { pixman_double_to_fixed (0), 0 };
     pixman_point_fixed_t p2 = { pixman_double_to_fixed (WIDTH),
 				pixman_int_to_fixed (0) };
+#if 0
     pixman_transform_t trans = {
 	{ { pixman_double_to_fixed (2), pixman_double_to_fixed (0.5), pixman_double_to_fixed (-100), },
 	  { pixman_double_to_fixed (0), pixman_double_to_fixed (3), pixman_double_to_fixed (0), },
 	  { pixman_double_to_fixed (0), pixman_double_to_fixed (0.000), pixman_double_to_fixed (1.0) } 
 	}
     };
-
-    pixman_transform_t id = {
+#else
+    pixman_transform_t trans = {
 	{ { pixman_fixed_1, 0, 0 },
 	  { 0, pixman_fixed_1, 0 },
 	  { 0, 0, pixman_fixed_1 } }
     };
+#endif
 
     pixman_point_fixed_t c_inner;
     pixman_point_fixed_t c_outer;
     pixman_fixed_t r_inner;
     pixman_fixed_t r_outer;
-    pixman_color_t red = { 0xffff, 0x0000, 0x0000, 0xffff };
     
     for (i = 0; i < WIDTH * HEIGHT; ++i)
 	alpha[i] = 0x4f00004f; /* pale blue */
@@ -91,7 +91,7 @@ main (int argc, char **argv)
     grad_img = pixman_image_create_linear_gradient  (&p1, &p2,
 						    stops, 2);
 
-    pixman_image_set_transform (grad_img, &id);
+    pixman_image_set_transform (grad_img, &trans);
     pixman_image_set_repeat (grad_img, PIXMAN_REPEAT_PAD);
     
     pixman_image_composite (PIXMAN_OP_OVER, grad_img, NULL, alpha_img,
diff --git a/test/blitters-test.c b/test/blitters-test.c
index 569e946..b8b6eba 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -56,7 +56,8 @@ aligned_malloc (size_t align, size_t size)
     void *result;
 
 #ifdef HAVE_POSIX_MEMALIGN
-    posix_memalign (&result, align, size);
+    if (posix_memalign (&result, align, size) != 0)
+      result = NULL;
 #else
     result = malloc (size);
 #endif
diff --git a/test/clip-test.c b/test/clip-test.c
index 9000137..cbab447 100644
--- a/test/clip-test.c
+++ b/test/clip-test.c
@@ -31,9 +31,11 @@ main (int argc, char **argv)
 	    { pixman_int_to_fixed (0), { 0xffff, 0x0000, 0x0000, 0xffff } },
 	    { pixman_int_to_fixed (1), { 0xffff, 0xffff, 0x0000, 0xffff } }
 	};
+#if 0
     pixman_point_fixed_t p1 = { 0, 0 };
     pixman_point_fixed_t p2 = { pixman_int_to_fixed (WIDTH),
 				pixman_int_to_fixed (HEIGHT) };
+#endif
     pixman_point_fixed_t c_inner;
     pixman_point_fixed_t c_outer;
     pixman_fixed_t r_inner;
diff --git a/test/composite-test.c b/test/composite-test.c
index 49e0220..2f14502 100644
--- a/test/composite-test.c
+++ b/test/composite-test.c
@@ -77,6 +77,9 @@ writer (void *src, uint32_t value, int size)
     case 4:
 	*(uint32_t *)src = value;
 	break;
+
+    default:
+        break;
     }
 }
 
@@ -113,7 +116,7 @@ main (int argc, char **argv)
 
     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
-    gtk_window_set_default_size (window, 800, 600);
+    gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
     
     g_signal_connect (window, "delete-event",
 		      G_CALLBACK (gtk_main_quit),
diff --git a/test/gradient-test.c b/test/gradient-test.c
index 2593ee3..c95c714 100644
--- a/test/gradient-test.c
+++ b/test/gradient-test.c
@@ -21,18 +21,20 @@ main (int argc, char **argv)
     pixman_point_fixed_t p1 = { pixman_double_to_fixed (0), 0 };
     pixman_point_fixed_t p2 = { pixman_double_to_fixed (WIDTH / 8.),
 				pixman_int_to_fixed (0) };
+#if 0
     pixman_transform_t trans = {
 	{ { pixman_double_to_fixed (2), pixman_double_to_fixed (0.5), pixman_double_to_fixed (-100), },
 	  { pixman_double_to_fixed (0), pixman_double_to_fixed (3), pixman_double_to_fixed (0), },
 	  { pixman_double_to_fixed (0), pixman_double_to_fixed (0.000), pixman_double_to_fixed (1.0) } 
 	}
     };
-
-    pixman_transform_t id = {
+#else
+    pixman_transform_t trans = {
 	{ { pixman_fixed_1, 0, 0 },
 	  { 0, pixman_fixed_1, 0 },
 	  { 0, 0, pixman_fixed_1 } }
     };
+#endif
 
     pixman_point_fixed_t c_inner;
     pixman_point_fixed_t c_outer;
@@ -67,7 +69,7 @@ main (int argc, char **argv)
     src_img = pixman_image_create_linear_gradient  (&p1, &p2,
 						    stops, 2);
     
-    pixman_image_set_transform (src_img, &id);
+    pixman_image_set_transform (src_img, &trans);
     pixman_image_set_repeat (src_img, PIXMAN_REPEAT_PAD);
     
     pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img,
diff --git a/test/utils.h b/test/utils.h
index bc110d8..2cb13bc 100644
--- a/test/utils.h
+++ b/test/utils.h
@@ -1,6 +1,13 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <glib.h>
+#include <gtk/gtk.h>
 #include "pixman.h"
 
 void show_image (pixman_image_t *image);
+
+GdkPixbuf *pixbuf_from_argb32 (uint32_t *bits,
+		               gboolean has_alpha,
+                               int width,
+                               int height,
+                               int stride);


More information about the xorg-commit mailing list