[gs-cvs] rev 8591 - trunk/gs/src
leonardo at ghostscript.com
leonardo at ghostscript.com
Fri Mar 7 05:39:36 PST 2008
Author: leonardo
Date: 2008-03-07 05:39:35 -0800 (Fri, 07 Mar 2008)
New Revision: 8591
Modified:
trunk/gs/src/gdevbbox.c
Log:
Fix (bbox device) : box_fill_path needs as path for shfill.
DETAILS :
Since revision 8017 the function gs_shfill includes a branch for
a faster handling of the Postscript operator shfill,
which does not provide a path to fill. It uses the clipping path instead.
The bbox device appears to be incompatible with that optimization.
This patch adds a special branch to bbox device to handle a shading fill
with no path.
Please note that since revision 8017 the call
dev_proc(dev, pattern_manage)(dev, gs_no_id, NULL, pattern_manage__shfill_doesnt_need_path)
must return a proper information about the device's fill_path method.
In most case it is doe with the default implementation gx_default_pattern_manage,
but the bbox device ises gx_forward_pattern_manage instead,
which appears wrong for bbox_fill_path. We decided to add an optomized branch
rather than apply the slow general method.
EXPECTED DIFFERENCES :
None.
Modified: trunk/gs/src/gdevbbox.c
===================================================================
--- trunk/gs/src/gdevbbox.c 2008-03-07 09:42:38 UTC (rev 8590)
+++ trunk/gs/src/gdevbbox.c 2008-03-07 13:39:35 UTC (rev 8591)
@@ -755,10 +755,24 @@
dev_proc(tdev, fill_path));
int code;
- if (!GX_DC_IS_TRANSPARENT(pdevc, bdev) && !gx_path_is_void(ppath)) {
+ if (ppath == NULL) {
+ /* A special handling of shfill with no path. */
gs_fixed_rect ibox;
gs_fixed_point adjust;
+ if (pcpath == NULL)
+ return 0;
+ gx_cpath_inner_box(pcpath, &ibox);
+ adjust = params->adjust;
+ if (params->fill_zero_width)
+ gx_adjust_if_empty(&ibox, &adjust);
+ adjust_box(&ibox, adjust);
+ BBOX_ADD_RECT(bdev, ibox.p.x, ibox.p.y, ibox.q.x, ibox.q.y);
+ return 0;
+ } else if (!GX_DC_IS_TRANSPARENT(pdevc, bdev) && !gx_path_is_void(ppath)) {
+ gs_fixed_rect ibox;
+ gs_fixed_point adjust;
+
if (gx_path_bbox(ppath, &ibox) < 0)
return 0;
adjust = params->adjust;
More information about the gs-cvs
mailing list