[gs-cvs] rev 9120 - trunk/gs/base
leonardo at ghostscript.com
leonardo at ghostscript.com
Thu Sep 25 03:10:03 PDT 2008
Author: leonardo
Date: 2008-09-25 03:10:03 -0700 (Thu, 25 Sep 2008)
New Revision: 9120
Modified:
trunk/gs/base/gxclpath.c
Log:
Fix (clist writer) : Wrong compositor cropping when a shading is entirely clipped out.
DETAILS :
Bug 690078 "clist error in fts_41xx.xps and fts_39xx.xps".
clist_fill_path implements a special processing of a clipping path for shadings.
It falls back to gx_default_fill_path, which accounts both filling path and clipping patch.
Doing so, gx_default_fill_path passes the clipping path to the clist writer
as a high level object with calling clist_fill_path with a NULL color.
However the 2 calls to clist_fill_path differently processed the
case of the empty clipping : the first call did not return immediately
and restored the compositor cropping interval after returning from gx_default_fill_path,
but the second call does return immediately and did not save the interval before
the clipping path is written. Thus the interval was restored to a wrong state
that occasionally left from a preceeding filling operation.
This patch moves the check for empty clipping ahead the main
processing in clist_fill_path, so that the 2 calls do same thing
about the skipping of an empty clipping.
EXPECTED DIFFERENCES :
None.
Modified: trunk/gs/base/gxclpath.c
===================================================================
--- trunk/gs/base/gxclpath.c 2008-09-25 01:36:16 UTC (rev 9119)
+++ trunk/gs/base/gxclpath.c 2008-09-25 10:10:03 UTC (rev 9120)
@@ -636,6 +636,29 @@
cmd_rects_enum_t re;
int code;
+ adjust = params->adjust;
+ {
+ gs_fixed_rect bbox;
+
+ if (ppath != NULL)
+ gx_path_bbox(ppath, &bbox);
+ else {
+ /* gx_default_fill_path passes the clip path for shfill. */
+ gx_cpath_outer_box(pcpath, &bbox);
+ }
+ ry = fixed2int(bbox.p.y) - 1;
+ rheight = fixed2int_ceiling(bbox.q.y) - ry + 1;
+ crop_fill_y(cdev, ry, rheight);
+ if (rheight <= 0)
+ return 0;
+ }
+ if ( (cdev->disable_mask & clist_disable_fill_path) ||
+ gs_debug_c(',')
+ ) {
+ /* Disable path-based banding. */
+ return gx_default_fill_path(dev, pis, ppath, params, pdcolor,
+ pcpath);
+ }
if (pdcolor != NULL && gx_dc_is_pattern2_color(pdcolor)) {
/* Here we need to intersect *ppath, *pcpath and shading bbox.
Call the default implementation, which has a special
@@ -652,29 +675,6 @@
cdev->save_cropping_min, cdev->save_cropping_max);
return code;
}
- if ( (cdev->disable_mask & clist_disable_fill_path) ||
- gs_debug_c(',')
- ) {
- /* Disable path-based banding. */
- return gx_default_fill_path(dev, pis, ppath, params, pdcolor,
- pcpath);
- }
- adjust = params->adjust;
- {
- gs_fixed_rect bbox;
-
- if (ppath != NULL)
- gx_path_bbox(ppath, &bbox);
- else {
- /* gx_default_fill_path passes the clip path for shfill. */
- gx_cpath_outer_box(pcpath, &bbox);
- }
- ry = fixed2int(bbox.p.y) - 1;
- rheight = fixed2int_ceiling(bbox.q.y) - ry + 1;
- crop_fill_y(cdev, ry, rheight);
- if (rheight <= 0)
- return 0;
- }
y0 = ry;
y1 = ry + rheight;
cmd_check_fill_known(cdev, pis, params->flatness, &adjust, pcpath,
More information about the gs-cvs
mailing list