[gs-cvs] rev 8123 - trunk/gs/src

leonardo at ghostscript.com leonardo at ghostscript.com
Fri Jul 13 11:48:05 PDT 2007


Author: leonardo
Date: 2007-07-13 11:48:05 -0700 (Fri, 13 Jul 2007)
New Revision: 8123

Modified:
   trunk/gs/src/gxclrect.c
Log:
Banding : Extend clist language with trapezoids, linear color trapezoids and linear color triangles (continued 3).

DETAILS :

1. Use fa->clip for a better Y-range for computing which bands are covered with fill_linear_color_triangle.

2. Provide a right raster op for linear color methods. Currently this change isn't
important because shadings don't use untrivial raster ops.
  
EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gxclrect.c
===================================================================
--- trunk/gs/src/gxclrect.c	2007-07-13 16:29:03 UTC (rev 8122)
+++ trunk/gs/src/gxclrect.c	2007-07-13 18:48:05 UTC (rev 8123)
@@ -291,13 +291,17 @@
 
     if (options & 4) {
 	if (swap_axes) {
-	    ry = fixed2int(min(min(left->start.x, left->end.x), right->start.x));
-	    rheight = fixed2int_ceiling(max(max(left->start.x, left->end.x), right->start.x)) - ry;
+	    ry = fixed2int(max(min(min(left->start.x, left->end.x), right->start.x), fa->clip->p.x));
+	    rheight = fixed2int_ceiling(min(max(max(left->start.x, left->end.x), right->start.x), fa->clip->q.x)) - ry;
 	} else {
-	    ry = fixed2int(min(min(left->start.y, left->end.y), right->start.y));
-	    rheight = fixed2int_ceiling(max(max(left->start.y, left->end.y), right->start.y)) - ry;
+	    ry = fixed2int(max(min(min(left->start.y, left->end.y), right->start.y), fa->clip->p.y));
+	    rheight = fixed2int_ceiling(min(max(max(left->start.y, left->end.y), right->start.y), fa->clip->q.y)) - ry;
 	}
     } else {
+	/* fixme: this may give a significant overestimation,
+	   so the command will be written to many bands.
+	   Would like to know a better range by X
+	   with computing intersections of sides with ybot, ytop. */
 	if (swap_axes) {
 	    ry = fixed2int(min(left->start.x, left->end.x));
 	    rheight = fixed2int_ceiling(max(right->start.x, right->end.x)) - ry;
@@ -384,7 +388,7 @@
     right.start = *p2;
     right.end = *p3;
     code = clist_write_fill_trapezoid(dev, &left, &right,
-	fa->ystart, fa->yend, fa->swap_axes | 2, NULL, lop_default, fa, c0, c1, c2, c3);
+	fa->ystart, fa->yend, fa->swap_axes | 2, NULL, fa->lop, fa, c0, c1, c2, c3);
     if (code < 0)
 	return code;
     /* NOTE : The return value 0 for the fill_linear_color_trapezoid method means
@@ -413,7 +417,7 @@
     right.end.x = right.end.y = 0; /* unused. */
 
     code = clist_write_fill_trapezoid(dev, &left, &right,
-	fa->ystart, fa->yend, fa->swap_axes | 2 | 4, NULL, lop_default, fa, c0, c1, c2, NULL);
+	fa->ystart, fa->yend, fa->swap_axes | 2 | 4, NULL, fa->lop, fa, c0, c1, c2, NULL);
     if (code < 0)
 	return code;
     /* NOTE : The return value 0 for the fill_linear_color_triangle method means



More information about the gs-cvs mailing list