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

leonardo at ghostscript.com leonardo at ghostscript.com
Tue Jan 29 03:54:50 PST 2008


Author: leonardo
Date: 2008-01-29 03:54:50 -0800 (Tue, 29 Jan 2008)
New Revision: 8511

Modified:
   trunk/gs/src/gximask.c
Log:
Fix (graphics) : Optimize filling a path with a shading color (continued).

DETAILS :

Bug 688970 "(shadings) Optimize filling a path with a shading color".

A minor code cleanup : prepare to eliminate gx_dc_pattern2_clip_with_bbox.

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gximask.c
===================================================================
--- trunk/gs/src/gximask.c	2008-01-28 23:02:59 UTC (rev 8510)
+++ trunk/gs/src/gximask.c	2008-01-29 11:54:50 UTC (rev 8511)
@@ -60,17 +60,25 @@
 gx_image_fill_masked_end(gx_device *dev, gx_device *tdev, const gx_device_color *pdevc)
 {
     gx_device_cpath_accum *pcdev = (gx_device_cpath_accum *)dev;
-    gx_clip_path cpath, cpath_with_shading_bbox;
+    gx_clip_path cpath;
+#   if SHADING_INTERSECT_CPATH_WITH_PATH_FIRST
+    gx_clip_path cpath_with_shading_bbox;
     const gx_clip_path *pcpath1 = &cpath;
+#   endif
     gx_device_clip cdev;
     int code, code1;
 
     gx_cpath_init_local(&cpath, pcdev->memory);
     code = gx_cpath_accum_end(pcdev, &cpath);
     if (code >= 0)
+#	if SHADING_INTERSECT_CPATH_WITH_PATH_FIRST
 	code = gx_dc_pattern2_clip_with_bbox(pdevc, tdev, &cpath_with_shading_bbox, &pcpath1);
+	gx_make_clip_device_on_stack(&cdev, pcpath1, tdev);
+#	else
+	code = gx_dc_pattern2_clip_with_bbox_simple(pdevc, tdev, &cpath);
+	gx_make_clip_device_on_stack(&cdev, &cpath, tdev);
+#	endif
     if (code >= 0) {
-	gx_make_clip_device_on_stack(&cdev, pcpath1, tdev);
 	code1 = gx_device_color_fill_rectangle(pdevc, 
 		    pcdev->bbox.p.x, pcdev->bbox.p.y, 
 		    pcdev->bbox.q.x - pcdev->bbox.p.x, 
@@ -80,8 +88,10 @@
 	    code = code1;
 	gx_device_retain((gx_device *)pcdev, false);
     }
+#   if SHADING_INTERSECT_CPATH_WITH_PATH_FIRST
     if (pcpath1 == &cpath_with_shading_bbox)
 	gx_cpath_free(&cpath_with_shading_bbox, "s_image_cleanup");
+#   endif
     gx_cpath_free(&cpath, "s_image_cleanup");
     return code;
 }



More information about the gs-cvs mailing list