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

leonardo at ghostscript.com leonardo at ghostscript.com
Wed May 7 14:02:17 PDT 2008


Author: leonardo
Date: 2008-05-07 14:02:16 -0700 (Wed, 07 May 2008)
New Revision: 8711

Modified:
   trunk/gs/src/gsptype1.c
Log:
Fix (graphics) : Wrong pattern phase when pattern applies to a band with non-zero origin.

DETAILS :

The old code computes pattern phase modulo rep_width, rep_height.
It appears wrong when pattern step is much bigger than the pattern bbox.
Really the bbox determines the painting area as rep_width, rep_height,
but the phase to be computed modulo pattern step.
Besides that, the old code aplies a wrong sign, which is oposite to a band offset.

This bug has no effect with Postscript interpreter, because 
currently patterns never apply after banding,
but it will change with the next patch.
With no banding the phase is always zero.

Other interpreters may need additional improvements
(we suspect they are bug-to-bug compatible).

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gsptype1.c
===================================================================
--- trunk/gs/src/gsptype1.c	2008-05-07 09:15:27 UTC (rev 8710)
+++ trunk/gs/src/gsptype1.c	2008-05-07 21:02:16 UTC (rev 8711)
@@ -1167,9 +1167,16 @@
 
 	    if (pdevc->type == &gx_dc_pattern) {	/* colored */
 		pdevc->colors.pattern.p_tile = ctile;
+#	    if 0 /* Debugged with Bug688308.ps and applying patterns after clist.
+		    Bug688308.ps has a step_matrix much bigger than pattern bbox;
+		    rep_width, rep_height can't be used as mod. 
+		    Would like to use step_matrix instead. */
 		color_set_phase_mod(pdevc, px, py,
 				    ctile->tbits.rep_width,
 				    ctile->tbits.rep_height);
+#		else
+		color_set_phase(pdevc, -px, -py);
+#		endif
 	    }
 	    pdevc->mask.m_tile =
 		(ctile->tmask.data == 0 ? (gx_color_tile *) 0 :



More information about the gs-cvs mailing list