[cairo-commit] libpixman/src ictrap.c,1.18,1.19

Carl Worth commit at pdx.freedesktop.org
Thu Mar 3 13:47:06 PST 2005


Committed by: cworth

Update of /cvs/cairo/libpixman/src
In directory gabe:/tmp/cvs-serv12268/src

Modified Files:
	ictrap.c 
Log Message:

        * src/ictrap.c (pixman_composite_trapezoids): Remove dead "if
        (!format)" code which also makes things more in synch with the
        server's mitrap.c.

Index: ictrap.c
===================================================================
RCS file: /cvs/cairo/libpixman/src/ictrap.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ictrap.c	3 Mar 2005 21:36:30 -0000	1.18
+++ ictrap.c	3 Mar 2005 21:47:04 -0000	1.19
@@ -107,20 +107,23 @@
     }
 }
 
+/* XXX: There are failure cases in this function. Don't we need to
+ * propagate the errors out?
+ */
 void
-pixman_composite_trapezoids (pixman_operator_t	op,
-		       pixman_image_t		*src,
-		       pixman_image_t		*dst,
-		       int		xSrc,
-		       int		ySrc,
-		       const pixman_trapezoid_t *traps,
-		       int		ntraps)
+pixman_composite_trapezoids (pixman_operator_t	      op,
+			     pixman_image_t	      *src,
+			     pixman_image_t	      *dst,
+			     int		      xSrc,
+			     int		      ySrc,
+			     const pixman_trapezoid_t *traps,
+			     int		      ntraps)
 {
-    pixman_image_t		*image = NULL;
+    pixman_image_t	*image = NULL;
     pixman_box16_t	bounds;
     int16_t		xDst, yDst;
     int16_t		xRel, yRel;
-    pixman_format_t		*format;
+    pixman_format_t	*format;
 
     if (ntraps == 0)
 	return;
@@ -129,56 +132,33 @@
     yDst = traps[0].left.p1.y >> 16;
     
     format = pixman_format_create (PIXMAN_FORMAT_NAME_A8);
+    if (!format)
+	return;
+
+    pixman_trapezoid_bounds (ntraps, traps, &bounds);
+    if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
+	return;
+    image = IcCreateAlphaPicture (dst, format,
+				  bounds.x2 - bounds.x1,
+				  bounds.y2 - bounds.y1);
+    if (!image)
+	return;
 
-    if (format)
-    {
-	pixman_trapezoid_bounds (ntraps, traps, &bounds);
-	if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
-	    return;
-	image = IcCreateAlphaPicture (dst, format,
-				      bounds.x2 - bounds.x1,
-				      bounds.y2 - bounds.y1);
-	if (!image)
-	    return;
-    }
     for (; ntraps; ntraps--, traps++)
     {
 	if (!xTrapezoidValid(traps))
 	    continue;
-	if (!format)
-	{
-	    pixman_trapezoid_bounds (1, traps, &bounds);
-	    if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
-		continue;
-	    image = IcCreateAlphaPicture (dst, format,
-					  bounds.x2 - bounds.x1,
-					  bounds.y2 - bounds.y1);
-	    if (!image)
-		continue;
-	}
 	fbRasterizeTrapezoid (image, traps, 
 			      -bounds.x1, -bounds.y1);
-	if (!format)
-	{
-	    xRel = bounds.x1 + xSrc - xDst;
-	    yRel = bounds.y1 + ySrc - yDst;
-	    pixman_composite (op, src, image, dst,
-			 xRel, yRel, 0, 0, bounds.x1, bounds.y1,
-			 bounds.x2 - bounds.x1,
-			 bounds.y2 - bounds.y1);
-	    pixman_image_destroy (image);
-	}
-    }
-    if (format)
-    {
-	xRel = bounds.x1 + xSrc - xDst;
-	yRel = bounds.y1 + ySrc - yDst;
-	pixman_composite (op, src, image, dst,
-		     xRel, yRel, 0, 0, bounds.x1, bounds.y1,
-		     bounds.x2 - bounds.x1,
-		     bounds.y2 - bounds.y1);
-	pixman_image_destroy (image);
     }
 
+    xRel = bounds.x1 + xSrc - xDst;
+    yRel = bounds.y1 + ySrc - yDst;
+    pixman_composite (op, src, image, dst,
+		      xRel, yRel, 0, 0, bounds.x1, bounds.y1,
+		      bounds.x2 - bounds.x1,
+		      bounds.y2 - bounds.y1);
+    pixman_image_destroy (image);
+
     pixman_format_destroy (format);
 }




More information about the cairo-commit mailing list