[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

pixman: Changes to 'debian-experimental'



 TODO                           |    4 
 configure                      |   20 +-
 configure.ac                   |    2 
 debian/changelog               |    4 
 pixman/Makefile.am             |    4 
 pixman/Makefile.in             |    6 
 pixman/pixman-compute-region.c |  206 ++++++++++++++++++++++++++
 pixman/pixman-edge.c           |   16 +-
 pixman/pixman-image.c          |  217 ++++++++++++++++++----------
 pixman/pixman-mmx.c            |  112 +++++---------
 pixman/pixman-mmx.h            |   46 ++---
 pixman/pixman-pict.c           |  316 ++++++++++++-----------------------------
 pixman/pixman-private.h        |    1 
 pixman/pixman-region.c         |   17 +-
 pixman/pixman-trap.c           |   25 +++
 pixman/pixman-utils.c          |   44 +++++
 pixman/pixman.h                |   97 ++++++++----
 test/composite-test.c          |    4 
 test/gradient-test.c           |    4 
 19 files changed, 690 insertions(+), 455 deletions(-)

New commits:
commit 94540025cb42111b0cb5a5511129e61d2cda3558
Author: Julien Cristau <jcristau@debian.org>
Date:   Thu Jun 14 00:00:10 2007 +0200

    autoreconf

diff --git a/configure b/configure
index b4884ff..53f70db 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for pixman 0.9.0.
+# Generated by GNU Autoconf 2.61 for pixman 0.9.3.
 #
 # Report bugs to <"sandmann@daimi.au.dk">.
 #
@@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='pixman'
 PACKAGE_TARNAME='pixman'
-PACKAGE_VERSION='0.9.0'
-PACKAGE_STRING='pixman 0.9.0'
+PACKAGE_VERSION='0.9.3'
+PACKAGE_STRING='pixman 0.9.3'
 PACKAGE_BUGREPORT='"sandmann@daimi.au.dk"'
 
 # Factoring default headers for most tests.
@@ -1401,7 +1401,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures pixman 0.9.0 to adapt to many kinds of systems.
+\`configure' configures pixman 0.9.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1471,7 +1471,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of pixman 0.9.0:";;
+     short | recursive ) echo "Configuration of pixman 0.9.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1576,7 +1576,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-pixman configure 0.9.0
+pixman configure 0.9.3
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1590,7 +1590,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by pixman $as_me 0.9.0, which was
+It was created by pixman $as_me 0.9.3, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2260,7 +2260,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='pixman'
- VERSION='0.9.0'
+ VERSION='0.9.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -20168,7 +20168,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by pixman $as_me 0.9.0, which was
+This file was extended by pixman $as_me 0.9.3, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -20221,7 +20221,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-pixman config.status 0.9.0
+pixman config.status 0.9.3
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/pixman/Makefile.in b/pixman/Makefile.in
index d82d570..e1ca10a 100644
--- a/pixman/Makefile.in
+++ b/pixman/Makefile.in
@@ -69,7 +69,7 @@ libpixman_mmx_la_OBJECTS = $(am_libpixman_mmx_la_OBJECTS)
 libpixman_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
 am_libpixman_la_OBJECTS = pixman-region.lo pixman-image.lo \
 	pixman-compose.lo pixman-pict.lo pixman-utils.lo \
-	pixman-edge.lo pixman-trap.lo
+	pixman-edge.lo pixman-trap.lo pixman-compute-region.lo
 libpixman_la_OBJECTS = $(am_libpixman_la_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -213,7 +213,8 @@ libpixman_la_SOURCES = \
 	pixman-utils.c		\
 	pixman-edge.c		\
 	pixman-edge-imp.h	\
-	pixman-trap.c
+	pixman-trap.c		\
+	pixman-compute-region.c
 
 @USE_MMX_TRUE@noinst_LTLIBRARIES = libpixman-mmx.la
 @USE_MMX_TRUE@libpixman_mmx_la_SOURCES = \
@@ -306,6 +307,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_mmx_la-pixman-mmx.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-compose.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-compute-region.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-edge.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-image.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-pict.Plo@am__quote@

commit e8dfb54ccea26b7e7948ca9806c97194892f0791
Author: Søren Sandmann <sandmann@redhat.com>
Date:   Tue Jun 12 23:50:04 2007 -0400

    Make default clip region the full image

diff --git a/TODO b/TODO
index 26eab05..d1beb74 100644
--- a/TODO
+++ b/TODO
@@ -62,4 +62,7 @@
 - Run cairo test suite; fix bugs
 	- one bug in source-scale-clip
 
+
+done:
+
 - Default clip region should be the full image
\ No newline at end of file
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index e47c7fc..8483068 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -279,7 +279,7 @@ create_bits (pixman_format_code_t format,
 
     if (rowstride_bytes)
 	*rowstride_bytes = stride;
-    
+
     return calloc (buf_size, 1);
 }
 
@@ -319,6 +319,9 @@ pixman_image_create_bits (pixman_format_code_t  format,
 								  */
     image->bits.indexed = NULL;
 
+    pixman_region_fini (&image->common.clip_region);
+    pixman_region_init_rect (&image->common.clip_region, 0, 0, width, height);
+
     return image;
 }
 

commit 42192ad0fc7fe0fa7600f879646de867691351bb
Author: Søren Sandmann <sandmann@redhat.com>
Date:   Tue Jun 12 23:37:25 2007 -0400

    Don't complain if users try to read non-existing data from images

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 3fe8977..e47c7fc 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -478,42 +478,46 @@ pixman_image_set_accessors (pixman_image_t             *image,
 uint32_t *
 pixman_image_get_data (pixman_image_t *image)
 {
-    return_val_if_fail (image->type == BITS, NULL);
+    if (image->type == BITS)
+	return image->bits.bits;
 
-    return image->bits.bits;
+    return NULL;
 }
 
 int
 pixman_image_get_width (pixman_image_t *image)
 {
-    return_val_if_fail (image->type == BITS, -1);
+    if (image->type == BITS)
+	return image->bits.width;
 
-    return image->bits.width;
-    
+    return 0;
 }
 
 int
 pixman_image_get_height (pixman_image_t *image)
 {
-    return_val_if_fail (image->type == BITS, -1);
+    if (image->type == BITS)
+	return image->bits.height;
 
-    return image->bits.height;
+    return 0;
 }
 
 int
 pixman_image_get_stride (pixman_image_t *image)
 {
-    return_val_if_fail (image->type == BITS, -1);
+    if (image->type == BITS)
+	return image->bits.rowstride * sizeof (uint32_t);
 
-    return sizeof (uint32_t) * image->bits.rowstride;
+    return 0;
 }
 
 int
 pixman_image_get_depth (pixman_image_t *image)
 {
-    return_val_if_fail (image->type == BITS, -1);
+    if (image->type == BITS)
+	return PIXMAN_FORMAT_DEPTH (image->bits.format);
 
-    return PIXMAN_FORMAT_DEPTH (image->bits.format);
+    return 0;
 }
 
 pixman_bool_t
diff --git a/pixman/pixman-trap.c b/pixman/pixman-trap.c
index 179bf8f..31f08d8 100644
--- a/pixman/pixman-trap.c
+++ b/pixman/pixman-trap.c
@@ -23,6 +23,7 @@
  */
 
 #include <config.h>
+#include <stdio.h>
 #include "pixman-private.h"
 
 typedef uint32_t FbBits;
@@ -119,6 +120,8 @@ pixman_rasterize_trapezoid (pixman_image_t *    image,
     pixman_fixed_t	y_off_fixed;
     pixman_edge_t	l, r;
     pixman_fixed_t	t, b;
+
+    return_if_fail (image->type == BITS);
     
     if (!pixman_trapezoid_valid (trap))
 	return;

commit 0e77667851869849cbddc30466db99ff5dc02b19
Author: Søren Sandmann <sandmann@redhat.com>
Date:   Tue Jun 12 22:53:35 2007 -0400

    Don't require rowstride to be a multiple of 4 when bits is NULL

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 467dcdb..3fe8977 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -294,7 +294,8 @@ pixman_image_create_bits (pixman_format_code_t  format,
 
     /* must be a whole number of uint32_t's 
      */
-    return_val_if_fail ((rowstride_bytes % sizeof (uint32_t)) == 0, NULL); 
+    return_val_if_fail (bits == NULL ||
+			(rowstride_bytes % sizeof (uint32_t)) == 0, NULL); 
 
     if (!bits)
     {

commit b6bdd8273cc3500d1f69402f39c3d6e718920a66
Author: Søren Sandmann <sandmann@redhat.com>
Date:   Tue Jun 12 22:14:32 2007 -0400

    Add pixman_fill_rectangles()

diff --git a/pixman/pixman-edge.c b/pixman/pixman-edge.c
index 06517e0..cec1902 100644
--- a/pixman/pixman-edge.c
+++ b/pixman/pixman-edge.c
@@ -406,12 +406,12 @@ _pixman_edge_tMultiInit (pixman_edge_t *e, int n, pixman_fixed_t *stepx_p, pixma
  */
 void
 pixman_edge_init (pixman_edge_t	*e,
-		int		n,
-		pixman_fixed_t		y_start,
-		pixman_fixed_t		x_top,
-		pixman_fixed_t		y_top,
-		pixman_fixed_t		x_bot,
-		pixman_fixed_t		y_bot)
+		  int		n,
+		  pixman_fixed_t		y_start,
+		  pixman_fixed_t		x_top,
+		  pixman_fixed_t		y_top,
+		  pixman_fixed_t		x_bot,
+		  pixman_fixed_t		y_bot)
 {
     pixman_fixed_t	dx, dy;
 
@@ -452,13 +452,13 @@ void
 pixman_line_fixed_edge_init (pixman_edge_t *e,
 			     int	    n,
 			     pixman_fixed_t	    y,
-			     pixman_line_fixed_t *line,
+			     const pixman_line_fixed_t *line,
 			     int	    x_off,
 			     int	    y_off)
 {
     pixman_fixed_t	x_off_fixed = pixman_int_to_fixed(x_off);
     pixman_fixed_t	y_off_fixed = pixman_int_to_fixed(y_off);
-    pixman_point_fixed_t *top, *bot;
+    const pixman_point_fixed_t *top, *bot;
 
     if (line->p1.y <= line->p2.y)
     {
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index d7ae309..467dcdb 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -321,7 +321,7 @@ pixman_image_create_bits (pixman_format_code_t  format,
     return image;
 }
 
-void
+pixman_bool_t
 pixman_image_set_clip_region (pixman_image_t    *image,
 			      pixman_region16_t *region)
 {
@@ -329,12 +329,14 @@ pixman_image_set_clip_region (pixman_image_t    *image,
 
     if (region)
     {
-	pixman_region_copy (&common->clip_region, region);
+	return pixman_region_copy (&common->clip_region, region);
     }
     else
     {
 	pixman_region_fini (&common->clip_region);
 	pixman_region_init (&common->clip_region);
+
+	return TRUE;
     }
 }
 
@@ -512,3 +514,31 @@ pixman_image_get_depth (pixman_image_t *image)
 
     return PIXMAN_FORMAT_DEPTH (image->bits.format);
 }
+
+pixman_bool_t
+pixman_image_fill_rectangles (pixman_op_t		    op,
+			      pixman_image_t		   *dest,
+			      pixman_color_t		   *color,
+			      int			    n_rects,
+			      const pixman_rectangle16_t   *rects)
+{
+    pixman_image_t *solid = pixman_image_create_solid_fill (color);
+    int i;
+
+    if (!solid)
+	return FALSE;
+
+    for (i = 0; i < n_rects; ++i)
+    {
+	const pixman_rectangle16_t *rect = &(rects[i]);
+	
+	pixman_image_composite (op, solid, NULL, dest,
+				0, 0, 0, 0,
+				rect->x, rect->y,
+				rect->width, rect->height);
+    }
+
+    pixman_image_unref (solid);
+
+    return TRUE;
+}
diff --git a/pixman/pixman-trap.c b/pixman/pixman-trap.c
index fb88d21..179bf8f 100644
--- a/pixman/pixman-trap.c
+++ b/pixman/pixman-trap.c
@@ -107,7 +107,7 @@ pixman_add_trapezoids       (pixman_image_t      *image,
 
 void
 pixman_rasterize_trapezoid (pixman_image_t *    image,
-			    pixman_trapezoid_t *trap,
+			    const pixman_trapezoid_t *trap,
 			    int			x_off,
 			    int			y_off)
 {
diff --git a/pixman/pixman.h b/pixman/pixman.h
index bda856c..0014cef 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -453,7 +453,7 @@ void            pixman_image_unref                   (pixman_image_t
 
 
 /* Set properties */
-void            pixman_image_set_clip_region         (pixman_image_t               *image,
+pixman_bool_t   pixman_image_set_clip_region         (pixman_image_t               *image,
 						      pixman_region16_t            *region);
 void		pixman_image_set_has_client_clip     (pixman_image_t               *image,
 						      pixman_bool_t		    clien_clip);
@@ -484,6 +484,11 @@ int		pixman_image_get_width               (pixman_image_t               *image);
 int             pixman_image_get_height              (pixman_image_t               *image);
 int		pixman_image_get_stride              (pixman_image_t               *image);
 int		pixman_image_get_depth               (pixman_image_t		   *image);
+pixman_bool_t	pixman_image_fill_rectangles	     (pixman_op_t		    op,
+						      pixman_image_t		   *image,
+						      pixman_color_t		   *color,
+						      int			    n_rects,
+						      const pixman_rectangle16_t	   *rects);
 
 /* Composite */
 pixman_bool_t   pixman_compute_composite_region (pixman_region16_t *	pRegion,
@@ -578,7 +583,7 @@ void           pixman_edge_init            (pixman_edge_t       *e,
 void           pixman_line_fixed_edge_init (pixman_edge_t       *e,
 					    int                  bpp,
 					    pixman_fixed_t       y,
-					    pixman_line_fixed_t *line,
+					    const pixman_line_fixed_t *line,
 					    int                  x_off,
 					    int                  y_off);
 void           pixman_rasterize_edges      (pixman_image_t      *image,
@@ -593,11 +598,11 @@ void           pixman_add_traps            (pixman_image_t      *image,
 					    pixman_trap_t       *traps);
 void	       pixman_add_trapezoids       (pixman_image_t      *image,
 					    int16_t              x_off,
-					    int                      y_off,
-					    int                      ntraps,
-					    const pixman_trapezoid_t *traps);
+					    int                  y_off,
+					    int                  ntraps,
+					    const pixman_trapezoid_t  *traps);
 void           pixman_rasterize_trapezoid  (pixman_image_t      *image,
-					    pixman_trapezoid_t  *trap,
+					    const pixman_trapezoid_t  *trap,
 					    int                  x_off,
 					    int                  y_off);
 

commit 0ab81dc6383e843aa3fa78da289820a55f4a08f0
Author: Søren Sandmann <sandmann@redhat.com>
Date:   Tue Jun 12 15:32:27 2007 -0400

    Add pixman_add_trapezoids() function

diff --git a/pixman/pixman-trap.c b/pixman/pixman-trap.c
index 3e66e88..fb88d21 100644
--- a/pixman/pixman-trap.c
+++ b/pixman/pixman-trap.c
@@ -86,6 +86,26 @@ pixman_add_traps (pixman_image_t *	image,
 }
 
 void
+pixman_add_trapezoids       (pixman_image_t      *image,
+			     int16_t              x_off,
+			     int                      y_off,
+			     int                      ntraps,
+			     const pixman_trapezoid_t *traps)
+{
+    int i;
+
+    for (i = 0; i < ntraps; ++i)
+    {
+	const pixman_trapezoid_t *trap = &(traps[i]);
+	
+	if (!pixman_trapezoid_valid (trap))
+	    continue;
+	
+	pixman_rasterize_trapezoid (image, trap, x_off, y_off);
+    }
+}
+
+void
 pixman_rasterize_trapezoid (pixman_image_t *    image,
 			    pixman_trapezoid_t *trap,
 			    int			x_off,
diff --git a/pixman/pixman.h b/pixman/pixman.h
index 229f76c..bda856c 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -591,6 +591,11 @@ void           pixman_add_traps            (pixman_image_t      *image,
 					    int16_t              y_off,
 					    int                  ntrap,
 					    pixman_trap_t       *traps);
+void	       pixman_add_trapezoids       (pixman_image_t      *image,
+					    int16_t              x_off,
+					    int                      y_off,
+					    int                      ntraps,
+					    const pixman_trapezoid_t *traps);
 void           pixman_rasterize_trapezoid  (pixman_image_t      *image,
 					    pixman_trapezoid_t  *trap,
 					    int                  x_off,

commit 756b54f6e45bb423ffabfcad2b6d8574130c6e53
Author: Søren Sandmann <sandmann@redhat.com>
Date:   Tue Jun 12 15:27:31 2007 -0400

    Add boolean returns to various setters

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index e6d366a..d7ae309 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -347,14 +347,14 @@ pixman_image_set_has_client_clip (pixman_image_t *image,
     image->common.has_client_clip = client_clip;
 }
 
-void
+pixman_bool_t
 pixman_image_set_transform (pixman_image_t           *image,
 			    const pixman_transform_t *transform)
 {
     image_common_t *common = (image_common_t *)image;
 
     if (common->transform == transform)
-	return;
+	return TRUE;
 
     if (common->transform)
 	free (common->transform);
@@ -363,7 +363,7 @@ pixman_image_set_transform (pixman_image_t           *image,
     {
 	common->transform = malloc (sizeof (pixman_transform_t));
 	if (!common->transform)
-	    return;
+	    return FALSE;
 
 	*common->transform = *transform;
     }
@@ -371,6 +371,8 @@ pixman_image_set_transform (pixman_image_t           *image,
     {
 	common->transform = NULL;
     }
+
+    return TRUE;
 }
 
 void
@@ -380,34 +382,37 @@ pixman_image_set_repeat (pixman_image_t  *image,
     image->common.repeat = repeat;
 }
 
-void
+pixman_bool_t 
 pixman_image_set_filter (pixman_image_t       *image,
 			 pixman_filter_t       filter,
 			 const pixman_fixed_t *params,
 			 int		       n_params)
 {
     image_common_t *common = (image_common_t *)image;
-    
-    if (params != common->filter_params || filter != common->filter)
+    pixman_fixed_t *new_params;
+
+    if (params == common->filter_params && filter == common->filter)
+	return TRUE;
+
+    new_params = NULL;
+    if (params)
     {
-	common->filter = filter;
-	
-	if (common->filter_params)
-	    free (common->filter_params);
+	new_params = malloc (n_params * sizeof (pixman_fixed_t));
+	if (!new_params)
+	    return FALSE;
 
-	if (params)
-	{
-	    common->filter_params = malloc (n_params * sizeof (pixman_fixed_t));
-	    memcpy (common->filter_params, params, n_params * sizeof (pixman_fixed_t));
-	}
-	else
-	{
-	    common->filter_params = NULL;
-	    n_params = 0;
-	}
+	memcpy (new_params,
+		params, n_params * sizeof (pixman_fixed_t));
     }
-    
+
+    common->filter = filter;
+	
+    if (common->filter_params)
+	free (common->filter_params);
+
+    common->filter_params = new_params;
     common->n_filter_params = n_params;
+    return TRUE;
 }
 
 /* Unlike all the other property setters, this function does not
diff --git a/pixman/pixman.h b/pixman/pixman.h
index 3ca6be0..229f76c 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -457,11 +457,11 @@ void            pixman_image_set_clip_region         (pixman_image_t
 						      pixman_region16_t            *region);
 void		pixman_image_set_has_client_clip     (pixman_image_t               *image,
 						      pixman_bool_t		    clien_clip);
-void            pixman_image_set_transform           (pixman_image_t               *image,
+pixman_bool_t   pixman_image_set_transform           (pixman_image_t               *image,
 						      const pixman_transform_t     *transform);
 void            pixman_image_set_repeat              (pixman_image_t               *image,
 						      pixman_repeat_t               repeat);
-void            pixman_image_set_filter              (pixman_image_t               *image,
+pixman_bool_t   pixman_image_set_filter              (pixman_image_t               *image,
 						      pixman_filter_t               filter,
 						      const pixman_fixed_t         *filter_params,
 						      int                           n_filter_params);

commit 6d62986ee0be7191ad6ef938d82cbadbe995c377
Author: Søren Sandmann <sandmann@redhat.com>
Date:   Tue Jun 12 14:30:53 2007 -0400

    Allow bits to be NULL when bit images are created

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index a719f3a..e6d366a 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -263,6 +263,26 @@ pixman_image_create_conical_gradient (pixman_point_fixed_t *center,
     return image;
 }
 
+static uint32_t *
+create_bits (pixman_format_code_t format,
+	     int		  width,
+	     int		  height,
+	     int		 *rowstride_bytes)
+{
+    int stride;
+    int buf_size;
+    int bpp;
+    
+    bpp = PIXMAN_FORMAT_BPP (format);
+    stride = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (uint32_t);
+    buf_size = height * stride;
+
+    if (rowstride_bytes)
+	*rowstride_bytes = stride;
+    
+    return calloc (buf_size, 1);
+}
+
 pixman_image_t *
 pixman_image_create_bits (pixman_format_code_t  format,
 			  int                   width,
@@ -276,6 +296,13 @@ pixman_image_create_bits (pixman_format_code_t  format,
      */
     return_val_if_fail ((rowstride_bytes % sizeof (uint32_t)) == 0, NULL); 
 
+    if (!bits)
+    {
+	bits = create_bits (format, width, height, &rowstride_bytes);
+	if (!bits)
+	    return NULL;
+    }
+    
     image = allocate_image();
 
     if (!image)

commit d466cf1d2f09f78baaafac713d6bc7d4f003b860
Author: Søren Sandmann <sandmann@redhat.com>
Date:   Tue Jun 12 14:24:40 2007 -0400

    Add various accessors; remove composite_rect

diff --git a/TODO b/TODO
index e7f6c57..26eab05 100644
--- a/TODO
+++ b/TODO
@@ -62,3 +62,4 @@
 - Run cairo test suite; fix bugs
 	- one bug in source-scale-clip
 
+- Default clip region should be the full image
\ No newline at end of file
diff --git a/configure.ac b/configure.ac
index 5b604f1..b759c7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ dnl Process this file with autoconf to create configure.
 
 AC_PREREQ([2.57])
 
-AC_INIT(pixman, 0.9.2, "sandmann@daimi.au.dk", pixman)
+AC_INIT(pixman, 0.9.3, "sandmann@daimi.au.dk", pixman)
 AM_INIT_AUTOMAKE([dist-bzip2])
 
 AM_CONFIG_HEADER(config.h)
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 1cc28b2..a719f3a 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -268,13 +268,13 @@ pixman_image_create_bits (pixman_format_code_t  format,
 			  int                   width,
 			  int                   height,
 			  uint32_t	       *bits,
-			  int			rowstride)
+			  int			rowstride_bytes)
 {
     pixman_image_t *image;
 
-    return_val_if_fail ((rowstride & 0x3) == 0, NULL); /* must be a
-							* multiple of 4
-							*/
+    /* must be a whole number of uint32_t's 
+     */
+    return_val_if_fail ((rowstride_bytes % sizeof (uint32_t)) == 0, NULL); 
 
     image = allocate_image();
 
@@ -286,9 +286,9 @@ pixman_image_create_bits (pixman_format_code_t  format,
     image->bits.width = width;
     image->bits.height = height;
     image->bits.bits = bits;
-    image->bits.rowstride = rowstride / 4; /* we store it in number
-					    * of uint32_t's
-					    */
+    image->bits.rowstride = rowstride_bytes / sizeof (uint32_t); /* we store it in number
+								  * of uint32_t's
+								  */
     image->bits.indexed = NULL;
 
     return image;
@@ -429,8 +429,6 @@ pixman_image_set_component_alpha   (pixman_image_t       *image,
 }
 
 
-#define SCANLINE_BUFFER_LENGTH 2048
-
 void
 pixman_image_set_accessors (pixman_image_t             *image,
 			    pixman_read_memory_func_t	read_func,
@@ -442,50 +440,43 @@ pixman_image_set_accessors (pixman_image_t             *image,
     image->common.write_func = write_func;
 }
 
-void
-pixman_image_composite_rect  (pixman_op_t                   op,
-			      pixman_image_t               *src,
-			      pixman_image_t               *mask,
-			      pixman_image_t               *dest,
-			      int16_t                       src_x,
-			      int16_t                       src_y,
-			      int16_t                       mask_x,
-			      int16_t                       mask_y,
-			      int16_t                       dest_x,
-			      int16_t                       dest_y,
-			      uint16_t                      width,
-			      uint16_t                      height)
+uint32_t *
+pixman_image_get_data (pixman_image_t *image)
 {
-    FbComposeData compose_data;
-    uint32_t _scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
-    uint32_t *scanline_buffer = _scanline_buffer;
+    return_val_if_fail (image->type == BITS, NULL);
 
-    return_if_fail (src != NULL);
-    return_if_fail (dest != NULL);
-    
-    if (width > SCANLINE_BUFFER_LENGTH)
-    {
-	scanline_buffer = (uint32_t *)malloc (width * 3 * sizeof (uint32_t));
+    return image->bits.bits;
+}
 
-	if (!scanline_buffer)
-	    return;
-    }
+int
+pixman_image_get_width (pixman_image_t *image)
+{
+    return_val_if_fail (image->type == BITS, -1);
+
+    return image->bits.width;
     
-    compose_data.op = op;
-    compose_data.src = src;
-    compose_data.mask = mask;
-    compose_data.dest = dest;
-    compose_data.xSrc = src_x;
-    compose_data.ySrc = src_y;
-    compose_data.xMask = mask_x;
-    compose_data.yMask = mask_y;
-    compose_data.xDest = dest_x;
-    compose_data.yDest = dest_y;
-    compose_data.width = width;
-    compose_data.height = height;
-
-    pixmanCompositeRect (&compose_data, scanline_buffer);
-
-    if (scanline_buffer != _scanline_buffer)
-	free (scanline_buffer);
+}
+
+int
+pixman_image_get_height (pixman_image_t *image)
+{
+    return_val_if_fail (image->type == BITS, -1);
+
+    return image->bits.height;
+}
+
+int
+pixman_image_get_stride (pixman_image_t *image)
+{
+    return_val_if_fail (image->type == BITS, -1);
+
+    return sizeof (uint32_t) * image->bits.rowstride;
+}
+
+int
+pixman_image_get_depth (pixman_image_t *image)
+{
+    return_val_if_fail (image->type == BITS, -1);
+
+    return PIXMAN_FORMAT_DEPTH (image->bits.format);
 }
diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index 5d5417c..741ede6 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -1063,6 +1063,56 @@ can_get_solid (pixman_image_t *image)
     }
 }
 
+#define SCANLINE_BUFFER_LENGTH 2048
+
+static void
+pixman_image_composite_rect  (pixman_op_t                   op,
+			      pixman_image_t               *src,
+			      pixman_image_t               *mask,
+			      pixman_image_t               *dest,
+			      int16_t                       src_x,
+			      int16_t                       src_y,
+			      int16_t                       mask_x,
+			      int16_t                       mask_y,
+			      int16_t                       dest_x,
+			      int16_t                       dest_y,
+			      uint16_t                      width,
+			      uint16_t                      height)
+{
+    FbComposeData compose_data;
+    uint32_t _scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
+    uint32_t *scanline_buffer = _scanline_buffer;
+
+    return_if_fail (src != NULL);
+    return_if_fail (dest != NULL);
+    
+    if (width > SCANLINE_BUFFER_LENGTH)
+    {
+	scanline_buffer = (uint32_t *)malloc (width * 3 * sizeof (uint32_t));
+
+	if (!scanline_buffer)
+	    return;
+    }
+    
+    compose_data.op = op;
+    compose_data.src = src;
+    compose_data.mask = mask;
+    compose_data.dest = dest;
+    compose_data.xSrc = src_x;
+    compose_data.ySrc = src_y;
+    compose_data.xMask = mask_x;
+    compose_data.yMask = mask_y;
+    compose_data.xDest = dest_x;
+    compose_data.yDest = dest_y;
+    compose_data.width = width;
+    compose_data.height = height;
+
+    pixmanCompositeRect (&compose_data, scanline_buffer);
+
+    if (scanline_buffer != _scanline_buffer)
+	free (scanline_buffer);
+}
+
 void
 pixman_image_composite (pixman_op_t      op,
 			pixman_image_t * pSrc,
diff --git a/pixman/pixman.h b/pixman/pixman.h
index 277fc0f..3ca6be0 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -479,6 +479,11 @@ void		pixman_image_set_accessors	     (pixman_image_t		   *image,
 						      pixman_write_memory_func_t    write_func);
 void		pixman_image_set_indexed	     (pixman_image_t		   *image,
 						      const pixman_indexed_t	   *indexed);
+uint32_t       *pixman_image_get_data                (pixman_image_t               *image);
+int		pixman_image_get_width               (pixman_image_t               *image);
+int             pixman_image_get_height              (pixman_image_t               *image);
+int		pixman_image_get_stride              (pixman_image_t               *image);
+int		pixman_image_get_depth               (pixman_image_t		   *image);
 
 /* Composite */
 pixman_bool_t   pixman_compute_composite_region (pixman_region16_t *	pRegion,
@@ -493,30 +498,18 @@ pixman_bool_t   pixman_compute_composite_region (pixman_region16_t *	pRegion,
 						 int16_t		yDst,
 						 uint16_t		width,
 						 uint16_t		height);
-void		pixman_image_composite               (pixman_op_t		    op,
-						      pixman_image_t		   *src,
-						      pixman_image_t               *mask,
-						      pixman_image_t               *dest,
-						      int16_t                       src_x,
-						      int16_t                       src_y,
-						      int16_t                       mask_x,
-						      int16_t                       mask_y,
-						      int16_t                       dest_x,
-						      int16_t                       dest_y,
-						      uint16_t                      width,
-						      uint16_t                      height);
-void            pixman_image_composite_rect          (pixman_op_t                   op,
-						      pixman_image_t               *src,
-						      pixman_image_t               *mask,
-						      pixman_image_t               *dest,
-						      int16_t                       src_x,
-						      int16_t                       src_y,
-						      int16_t                       mask_x,
-						      int16_t                       mask_y,
-						      int16_t                       dest_x,
-						      int16_t                       dest_y,
-						      uint16_t                      width,
-						      uint16_t                      height);
+void		pixman_image_composite          (pixman_op_t		    op,
+						 pixman_image_t		   *src,
+						 pixman_image_t               *mask,
+						 pixman_image_t               *dest,
+						 int16_t                       src_x,
+						 int16_t                       src_y,
+						 int16_t                       mask_x,
+						 int16_t                       mask_y,
+						 int16_t                       dest_x,
+						 int16_t                       dest_y,
+						 uint16_t                      width,
+						 uint16_t                      height);
 
 /*
  * Trapezoids
diff --git a/test/composite-test.c b/test/composite-test.c
index 567d620..cee9609 100644
--- a/test/composite-test.c
+++ b/test/composite-test.c
@@ -129,8 +129,8 @@ main (int argc, char **argv)
 					 dest,
 					 WIDTH * 4);
 
-    pixman_image_composite_rect (PIXMAN_OP_OVER, src_img, NULL, dest_img,
-				 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+    pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img,
+			    0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
 
 #if 0
     for (i = 0; i < WIDTH; ++i)
diff --git a/test/gradient-test.c b/test/gradient-test.c
index 149d034..f6e3ca3 100644
--- a/test/gradient-test.c
+++ b/test/gradient-test.c
@@ -129,8 +129,8 @@ main (int argc, char **argv)
 #endif
     pixman_image_set_transform (src_img, &trans);
     
-    pixman_image_composite_rect (PIXMAN_OP_OVER, src_img, NULL, dest_img,
-				 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);



Reply to: