[gs-code-review] upath and clippath interaction.

Alex Cherepanov alexcher at quadnet.net
Wed Nov 8 05:39:32 PST 2006


upath operator fails on Adobe interpreters when currentpoint is not set.
This is tested by CET 11-08 and a number of other files. The proposed
patch brings upath operator into compliance with Adobe.

However, this change also causes a few regressions in CET suite.
Adobe clippath operator sets the currentpoint but our doesn't.
A few CET files use upath after clippath.

Fixing clippath may take some time. Should I commit the fix for upath
now? The net difference is progression.


-------------- next part --------------
Index: gs/src/zupath.c
===================================================================
--- gs/src/zupath.c	(revision 7161)
+++ gs/src/zupath.c	(working copy)
@@ -456,6 +456,11 @@
     ref *next;
     int code;
 
+    /* Although PLRM doesn't list nocurrentpoint as a possible error */
+    /* from 'upath', we follow Adobe implementation and CET 11-08.PS */
+    if (!pgs->current_point_valid)
+	return_error(e_nocurrentpoint);
+
     /* Compute the size of the user path array. */
     {
 	gs_fixed_point pts[3];
@@ -492,16 +497,8 @@
     } {
 	gs_rect bbox;
 
-	if ((code = gs_upathbbox(pgs, &bbox, true)) < 0) {
-	    /*
-	     * Note: Adobe throws 'nocurrentpoint' error, but the PLRM
-	     * not list this as a possible error from 'upath', so we
-	     * set a reasonable default bbox instead.
-	     */
-	    if (code != e_nocurrentpoint)
-		return code;
-	    bbox.p.x = bbox.p.y = bbox.q.x = bbox.q.y = 0;
-	}
+	if ((code = gs_upathbbox(pgs, &bbox, true)) < 0)
+	    return code;
 	make_real_new(next, bbox.p.x);
 	make_real_new(next + 1, bbox.p.y);
 	make_real_new(next + 2, bbox.q.x);


More information about the gs-code-review mailing list