[cairo-commit] cairo/pixman/src fbcompose.c, 1.5, 1.6 icimage.c, 1.34, 1.35 icimage.h, 1.29, 1.30

Carl Worth commit at pdx.freedesktop.org
Wed Jan 4 16:39:25 PST 2006


Committed by: cworth

Update of /cvs/cairo/cairo/pixman/src
In directory gabe:/tmp/cvs-serv18600/pixman/src

Modified Files:
	fbcompose.c icimage.c icimage.h 
Log Message:

2006-01-04  Carl Worth  <cworth at cworth.org>

        * Originally: 2005-10-10  David Reveman  <davidr at novell.com>

        * src/fbcompose.c: (SourcePictureClassify), (fbFetchSolid),
        (fbFetch), (fbFetchSourcePict), (fbFetchTransformed),
        (fbFetchExternalAlpha), (fbCompositeRect):
        * src/icimage.c: (_pixman_init_gradient),
        (_pixman_create_source_image),
        (pixman_image_create_linear_gradient),
        (pixman_image_create_radial_gradient):
        * src/icimage.h:

        Some major performance improvements to the general composite code
        used for gradients and transformed images. Like fetching of mask
        scanline before source scanline so that only the necessary pixels
        from source needs to be computed in case of gradients or
        transformed images as source. This patch also include some
        gradient specific fixes and performance improvement.


Index: fbcompose.c
===================================================================
RCS file: /cvs/cairo/cairo/pixman/src/fbcompose.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- fbcompose.c	5 Jan 2006 00:26:10 -0000	1.5
+++ fbcompose.c	5 Jan 2006 00:39:23 -0000	1.6
@@ -66,6 +66,65 @@
     return TRUE;
 }
 
+static unsigned int
+SourcePictureClassify (PicturePtr pict,
+		       int	  x,
+		       int	  y,
+		       int	  width,
+		       int	  height)
+{
+    if (pict->pSourcePict->type == SourcePictTypeSolidFill)
[...1328 lines suppressed...]
+			       data->width, dest_buffer, 0, 0);
+
+		/* blend */
+		compose (dest_buffer, src_mask_buffer, data->width);
+
+		/* write back */
+		store (data->dest, data->xDest, data->yDest + i, data->width,
+		       dest_buffer);
+	    }
+	    else
+	    {
+		/* blend */
+		compose (bits + (data->yDest + i+ yoff) * stride +
+			 data->xDest + xoff,
+			 src_mask_buffer, data->width);
+	    }
+	}
     }
 }
 

Index: icimage.c
===================================================================
RCS file: /cvs/cairo/cairo/pixman/src/icimage.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- icimage.c	5 Jan 2006 00:26:10 -0000	1.34
+++ icimage.c	5 Jan 2006 00:39:23 -0000	1.35
@@ -240,6 +240,7 @@
 	dpos = stops[i].x;
     }
 
+    gradient->class	     = SourcePictClassUnknown;
     gradient->stopRange	     = 0xffff;
     gradient->colorTable     = NULL;
     gradient->colorTableSize = 0;
@@ -253,8 +254,9 @@
     pixman_image_t *image;
 
     image = (pixman_image_t *) malloc (sizeof (pixman_image_t));
-    image->pDrawable = 0;
-    image->pixels    = 0;
+    image->pDrawable   = 0;
+    image->pixels      = 0;
+    image->format_code = PICT_a8r8g8b8;
 
     pixman_image_init (image);
 
@@ -276,9 +278,6 @@
     if (!image)
 	return 0;
 
-    if (gradient->p1.x == gradient->p2.x && gradient->p1.y == gradient->p2.y)
-	return 0;
-
     linear = malloc (sizeof (pixman_linear_gradient_image_t) +
 		     sizeof (pixman_gradient_stop_t) * n_stops);
     if (!linear)
@@ -314,7 +313,7 @@
 {
     pixman_radial_gradient_image_t *radial;
     pixman_image_t		   *image;
-    double			   dx, dy, x;
+    double			   x;
 
     if (n_stops < 2)
 	return 0;
@@ -323,12 +322,6 @@
     if (!image)
 	return 0;
 
-    dx = (double) (gradient->inner.x - gradient->outer.x);
-    dy = (double) (gradient->inner.y - gradient->outer.y);
-    if (sqrt (dx * dx + dy * dy) + (double) (gradient->inner.radius) >
-	(double) (gradient->outer.radius))
-	return 0;
-
     radial = malloc (sizeof (pixman_radial_gradient_image_t) +
 		     sizeof (pixman_gradient_stop_t) * n_stops);
     if (!radial)

Index: icimage.h
===================================================================
RCS file: /cvs/cairo/cairo/pixman/src/icimage.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- icimage.h	5 Jan 2006 00:26:10 -0000	1.29
+++ icimage.h	5 Jan 2006 00:39:23 -0000	1.30
@@ -61,13 +61,19 @@
 #define SourcePictTypeRadial    2
 #define SourcePictTypeConical   3
 
+#define SourcePictClassUnknown    0
+#define SourcePictClassHorizontal 1
+#define SourcePictClassVertical   2
+
 typedef struct _pixman_solid_fill_image {
     unsigned int type;
+    unsigned int class;
     uint32_t	 color;
 } pixman_solid_fill_image_t;
 
 typedef struct _pixman_gradient_image {
     unsigned int	   type;
+    unsigned int	   class;
     pixman_gradient_stop_t *stops;
     int			   nstops;
     int			   stopRange;
@@ -77,6 +83,7 @@
 
 typedef struct _pixman_linear_gradient_image {
     unsigned int	   type;
+    unsigned int	   class;
     pixman_gradient_stop_t *stops;
     int			   nstops;
     int			   stopRange;
@@ -88,6 +95,7 @@
 
 typedef struct _pixman_radial_gradient_image {
     unsigned int	   type;
+    unsigned int	   class;
     pixman_gradient_stop_t *stops;
     int			   nstops;
     int			   stopRange;
@@ -104,6 +112,7 @@
 
 typedef struct _pixman_conical_gradient_image {
     unsigned int	   type;
+    unsigned int	   class;
     pixman_gradient_stop_t *stops;
     int			   nstops;
     int			   stopRange;



More information about the cairo-commit mailing list