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

leonardo at ghostscript.com leonardo at ghostscript.com
Wed Oct 10 08:28:27 PDT 2007


Author: leonardo
Date: 2007-10-10 08:28:26 -0700 (Wed, 10 Oct 2007)
New Revision: 8282

Modified:
   trunk/gs/src/gxstroke.c
Log:
Fix (stroking) : Prevent installing an extra clipper device.

DETAILS :

Bug 689427 "Superposed clippers".

The old code installs a clipper in gx_stroke_path_only_aux
and then (indirectly) calls gx_general_fill_path
with passing same clipping path. It caused gx_general_fill_path
to install a second clipper with same clipping path.
This patch simply passes down a NULL clipping path.

Minor change : Added a 'pcpath' argument to the macro
FILL_STROKE_PATH for easier understanding and debugging.

EXPECTED DIFFERENCES :

None,


Modified: trunk/gs/src/gxstroke.c
===================================================================
--- trunk/gs/src/gxstroke.c	2007-10-10 10:13:45 UTC (rev 8281)
+++ trunk/gs/src/gxstroke.c	2007-10-10 15:28:26 UTC (rev 8282)
@@ -236,7 +236,7 @@
 /* Fill a partial stroked path.  Free variables: */
 /* to_path, stroke_path_body, fill_params, always_thin, pis, dev, pdevc, */
 /* code, ppath, exit(label). */
-#define FILL_STROKE_PATH(thin)\
+#define FILL_STROKE_PATH(thin, pcpath)\
   if(to_path==&stroke_path_body && !gx_path_is_void(&stroke_path_body)) {\
     fill_params.adjust.x = STROKE_ADJUSTMENT(thin, pis, x);\
     fill_params.adjust.y = STROKE_ADJUSTMENT(thin, pis, y);\
@@ -285,7 +285,7 @@
 static int
 gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
 	       const gs_imager_state * pis, const gx_stroke_params * params,
-		 const gx_device_color * pdevc, const gx_clip_path * pcpath)
+		 const gx_device_color * pdevc, const gx_clip_path * pcpath0)
 {
     extern bool CPSI_mode;
     stroke_line_proc_t line_proc =
@@ -302,6 +302,7 @@
     const gx_path *spath;
     float xx = pis->ctm.xx, xy = pis->ctm.xy;
     float yx = pis->ctm.yx, yy = pis->ctm.yy;
+    const gx_clip_path * pcpath = pcpath0;
     /*
      * We are dealing with a reflected coordinate system
      * if transform(1,0) is counter-clockwise from transform(0,1).
@@ -440,6 +441,7 @@
 	    gx_make_clip_device_on_stack(&cdev, pcpath, dev);
 	    cdev.max_fill_band = dev->max_fill_band;
 	    dev = (gx_device *) & cdev;
+	    pcpath = NULL;
 	}
     }
     fill_params.rule = gx_rule_winding_number;
@@ -756,7 +758,7 @@
 				     uniform, join, initial_matrix_reflected);
 		if (code < 0)
 		    goto exit;
-		FILL_STROKE_PATH(always_thin);
+		FILL_STROKE_PATH(always_thin, pcpath);
 	    } else
 		pl_first = pl;
 	    pl_prev = pl;
@@ -778,13 +780,13 @@
 				 initial_matrix_reflected);
 	    if (code < 0)
 		goto exit;
-	    FILL_STROKE_PATH(always_thin);
+	    FILL_STROKE_PATH(always_thin, pcpath);
 	    if (CPSI_mode && lptr == 0 && pgs_lp->cap != gs_cap_butt) {
 		/* Create the initial cap at last. */
 		code = stroke_add_initial_cap_compat(to_path, &pl_first, index == 1, pdevc, dev, pis);
 		if (code < 0)
 		    goto exit;
-		FILL_STROKE_PATH(always_thin);
+		FILL_STROKE_PATH(always_thin, pcpath);
 	    }
 	}
 	psub = (const subpath *)pseg;



More information about the gs-cvs mailing list