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

pixman: Changes to 'upstream-experimental'



 TODO                           |    4 
 configure.ac                   |    2 
 pixman/Makefile.am             |    4 
 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 
 16 files changed, 674 insertions(+), 441 deletions(-)

New commits:
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);
+    pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img,
+			    0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
     
     printf ("0, 0: %x\n", dest[0]);
     printf ("10, 10: %x\n", dest[10 * 10 + 10]);

commit b62b769c0da8d8eae68bd41a53f390c1f0917be0
Author: Søren Sandmann Pedersen <sandmann@redhat.com>
Date:   Mon Jun 11 22:02:03 2007 -0400

    Bump version number

diff --git a/configure.ac b/configure.ac
index ee5b8ad..5b604f1 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.1, "sandmann@daimi.au.dk", pixman)
+AC_INIT(pixman, 0.9.2, "sandmann@daimi.au.dk", pixman)
 AM_INIT_AUTOMAKE([dist-bzip2])
 
 AM_CONFIG_HEADER(config.h)

commit c663029510c8a329dc87246cc895b21f0af79eb6
Author: Søren Sandmann Pedersen <sandmann@redhat.com>
Date:   Mon Jun 11 21:39:24 2007 -0400

    Make use of pixman_fill_mmx() in various places. Delete #if0'ed code

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 84f440d..ba2b873 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -1768,144 +1768,6 @@ pixman_fill_mmx (uint32_t *bits,
     return TRUE;
 }
 
-#if 0
-/* FIXME */
-
-Bool
-fbSolidFillmmx (DrawablePtr	pDraw,
-		int		x,
-		int		y,
-		int		width,
-		int		height,
-		uint32_t		xor)
-{ 
-    int	stride;
-    int		bpp;
-    ullong	fill;
-    __m64	vfill;
-    uint32_t	byte_width;
-    uint8_t	*byte_line;
-    uint32_t      *bits;
-    int		xoff, yoff;
-#ifdef __GNUC__
-    __m64	v1, v2, v3, v4, v5, v6, v7;
-#endif
-    
-    CHECKPOINT();
-    
-    fbGetDrawable(pDraw, bits, stride, bpp, xoff, yoff);
-    
-    if (bpp == 16 && (xor >> 16 != (xor & 0xffff)))
-	return FALSE;
-    
-    if (bpp != 16 && bpp != 32)
-	return FALSE;
-    
-    if (bpp == 16)
-    {
-	stride = stride * sizeof (uint32_t) / 2;
-	byte_line = (uint8_t *)(((uint16_t *)bits) + stride * (y + yoff) + (x + xoff));
-	byte_width = 2 * width;
-	stride *= 2;
-    }
-    else
-    {
-	stride = stride * sizeof (uint32_t) / 4;
-	byte_line = (uint8_t *)(((uint32_t *)bits) + stride * (y + yoff) + (x + xoff));
-	byte_width = 4 * width;
-	stride *= 4;
-    }
-    
-    fill = ((ullong)xor << 32) | xor;
-    vfill = (__m64)fill;
-    
-#ifdef __GNUC__
-    __asm__ (
-	"movq		%7,	%0\n"
-	"movq		%7,	%1\n"
-	"movq		%7,	%2\n"
-	"movq		%7,	%3\n"
-	"movq		%7,	%4\n"
-	"movq		%7,	%5\n"
-	"movq		%7,	%6\n"
-	: "=y" (v1), "=y" (v2), "=y" (v3),
-	  "=y" (v4), "=y" (v5), "=y" (v6), "=y" (v7)
-	: "y" (vfill));
-#endif
-    
-    while (height--)
-    {
-	int w;
-	uint8_t *d = byte_line;
-	byte_line += stride;
-	w = byte_width;
-	
-	while (w >= 2 && ((unsigned long)d & 3))
-	{
-	    *(uint16_t *)d = xor;
-	    w -= 2;
-	    d += 2;
-	}
-	
-	while (w >= 4 && ((unsigned long)d & 7))
-	{
-	    *(uint32_t *)d = xor;
-	    
-	    w -= 4;
-	    d += 4;
-	}
-



Reply to: