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

leonardo at ghostscript.com leonardo at ghostscript.com
Thu May 24 15:05:57 PDT 2007


Author: leonardo
Date: 2007-05-24 15:05:57 -0700 (Thu, 24 May 2007)
New Revision: 8003

Modified:
   trunk/gs/src/gxshade6.c
Log:
Fix (shadings) : A bug in tensor patch size formula caused extra or missewd subdivisions.

DETAILS : 

See the formula for L.
Also inserted some debug drawing, which are disabled.

As a secondary effect, this patch may close problems
related to wedge vertex buffer overflow.

EXPECTED DIFFERENCES :

"478-01.ps" - With "1 setsmoothness" the color isn't really important.

A minor difference in color :
"442-01.ps" 
"464-01-fixed.ps" 
"478-01.ps" 
"483-01.ps" 
"Altona-Testsuite_p2_S_x3.pdf" 
"Altona_Visual_bb_1v1_x3.pdf" 
"Altona_Visual_sb_1v1_x3.pdf" 
"Bug688631.pdf" 
"Bug689189.pdf" 
"chilis_black.pdf" 
"chilis_red.pdf" 
"Clarke Tate Manns Chinese.ai" 
"S2_Digitalproof-Forum_x3k.pdf" 
"shading_prob_800.ps" 
"STEUER-RollingMesh 1(linear).ai" 
"STEUER-RollingMesh 2(radial).ai" 
"STEUER-RollingMesh 3(Final).ai" 
"Testform.v1.0.2.pdf" 


Modified: trunk/gs/src/gxshade6.c
===================================================================
--- trunk/gs/src/gxshade6.c	2007-05-24 18:46:03 UTC (rev 8002)
+++ trunk/gs/src/gxshade6.c	2007-05-24 22:05:57 UTC (rev 8003)
@@ -747,7 +747,7 @@
 {
 #ifdef DEBUG
 #if 0 /* Disabled for a better view with a specific purpose. 
-	 Feel free to enable fo needed. */
+	 Feel free to enable if needed. */
     int i, step = (interior ? 1 : 3);
 
     for (i = 0; i < 4; i += step) {
@@ -806,9 +806,9 @@
     {	
 #	if LAZY_WEDGES || QUADRANGLES
 	    int k1;
-	    fixed L = any_abs(pole[1].x - pole[0].x) + any_abs(pole[1].y - pole[0].y) +
-		      any_abs(pole[2].x - pole[1].x) + any_abs(pole[2].y - pole[1].y) +
-		      any_abs(pole[3].x - pole[2].x) + any_abs(pole[3].y - pole[2].y);
+	    fixed L = any_abs(pole[pole_step * 1].x - pole[pole_step * 0].x) + any_abs(pole[pole_step * 1].y - pole[pole_step * 0].y) +
+		      any_abs(pole[pole_step * 2].x - pole[pole_step * 1].x) + any_abs(pole[pole_step * 2].y - pole[pole_step * 1].y) +
+		      any_abs(pole[pole_step * 3].x - pole[pole_step * 2].x) + any_abs(pole[pole_step * 3].y - pole[pole_step * 2].y);
 #	endif
 
 #	if LAZY_WEDGES
@@ -3288,6 +3288,8 @@
     /* The stripe is flattened enough by V, so ignore inner poles. */
     int ku[4], kum, code;
 
+    if (0)
+	draw_patch(p, true, RGB(0, 255, 255)); /* Debug purpose only. */
     /* We would like to apply iterations for enumerating the kum curve parts,
        but the roundinmg errors would be too complicated due to
        the dependence on the direction. Note that neigbour
@@ -3525,6 +3527,8 @@
 	color_stack_ptr = reserve_colors_inline(pfs, c, 2);
 	if(color_stack_ptr == NULL)
 	    return_error(gs_error_unregistered); /* Must not happen. */
+	if (0)
+	    draw_patch(p, true, RGB(255, 255, 0)); /* Debug purpose only. */
 	split_patch(pfs, &s0, &s1, p, c);
 	if (kv0 <= 1) {
 	    q0.p = s0.pole[0][0];



More information about the gs-cvs mailing list