[gs-cvs] gs/src
Igor Melichev
igor at ghostscript.com
Mon Apr 4 04:53:12 PDT 2005
Update of /cvs/ghostscript/gs/src
In directory casper2:/tmp/cvs-serv4617/gs/src
Modified Files:
gdevpdfd.c
Log Message:
ps2write : Convert shadings into a clipped image (continued 7).
DETAILS :
1. Check for empty bbox before pdf_setup_masked_image_converter,
because memory devices with empty bbox fail.
2. Create a copy of a path_intersection before scaling it,
because it may be shared.
3. Fixed the client name gdev_pdf_fill_path when calling some path functions.
Debugged with 478-01.ps .
EXPECTED DIFFERENCES :
None.
Index: gdevpdfd.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpdfd.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- gdevpdfd.c 4 Apr 2005 09:32:26 -0000 1.56
+++ gdevpdfd.c 4 Apr 2005 11:53:10 -0000 1.57
@@ -1072,6 +1072,8 @@
return code;
if (code)
rect_intersect(bbox, bbox1);
+ if (bbox.p.x >= bbox.q.x || bbox.p.y >= bbox.q.y)
+ return 0;
sx = fixed2int(bbox.p.x);
sy = fixed2int(bbox.p.y);
gs_distance_transform_inverse(sx * pdev->HWResolution[0] / 72,
@@ -1126,18 +1128,25 @@
if (code >= 0) {
/* See gx_default_fill_path. */
gx_clip_path cpath_intersection;
- gx_path path_intersection;
+ gx_path path_intersection, path1, *p = &path_intersection;
gx_path_init_local(&path_intersection, pdev->memory);
+ gx_path_init_local(&path1, pdev->memory);
gx_cpath_init_local_shared(&cpath_intersection, pcpath, pdev->memory);
if ((code = gx_cpath_intersect(&cpath_intersection, ppath, params->rule, (gs_imager_state *)pis)) >= 0)
code = gx_cpath_to_path(&cpath_intersection, &path_intersection);
+ if (code >= 0 && scale > 1) {
+ code = gx_path_copy(&path_intersection, &path1);
+ if (code > 0) {
+ p = &path1;
+ code = path_scale(&path1, scalex, scaley);
+ }
+ }
if (code >= 0)
- code = path_scale(&path_intersection, scalex, scaley);
- if (code >= 0)
- code = gx_dc_pattern2_fill_path(&dc, &path_intersection, NULL, (gx_device *)&cvd.mdev);
- gx_path_free(&path_intersection, "shading_fill_path_intersection");
- gx_cpath_free(&cpath_intersection, "shading_fill_cpath_intersection");
+ code = gx_dc_pattern2_fill_path(&dc, p, NULL, (gx_device *)&cvd.mdev);
+ gx_path_free(&path_intersection, "gdev_pdf_fill_path");
+ gx_path_free(&path1, "gdev_pdf_fill_path");
+ gx_cpath_free(&cpath_intersection, "gdev_pdf_fill_path");
}
if (code >= 0) {
code = pdf_dump_converted_image(pdev, &cvd);
More information about the gs-cvs
mailing list