From 05c41c0dedaa512419f15798cbc3da92b6a90bbc Mon Sep 17 00:00:00 2001 From: Michael Vrhel Date: Sat, 11 Jan 2020 12:14:48 -0800 Subject: Squashed commit fill-stroke3 branch This branch had several contributors including Robin Watts, Ken Sharp and Ray Johnston. The intent was to add a "fill and stroke" path device method to ensure we get proper rendering when doing fill/stroke methods with overprint and transparency. In addition, adding the method made it possible for pdfwrite to match the original pdf source file if it also had fill/stroke methods. The interaction with overprint and transparency led to significant changes in parts of the code related to those sections. In particular, overprint was reworked to ensure that the overprint compositor and the transparency compositor were aware if it was to be using the overprint drawn_comps for stroke or for fill. The code was rewritten so that the overprint compositor actions only occurred when an actual operation occurred (e.g. fill, stroke, image, text) as opposed to every time that the overprint graphic state values changed. When there is a fill-stroke operation with transparency, depending upon the graphic state values, a non-isolated knockout group may be pushed. From this, an issue with knockout groups within knockout groups was revealed, which was related to the backdrop selection. The backdrop selection code was simplified. --- base/gdevnfwd.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'base/gdevnfwd.c') diff --git a/base/gdevnfwd.c b/base/gdevnfwd.c index a78d3038d..4174c957a 100644 --- a/base/gdevnfwd.c +++ b/base/gdevnfwd.c @@ -117,7 +117,9 @@ gx_device_forward_fill_in_procs(register gx_device_forward * dev) fill_dev_proc(dev, set_graphics_type_tag, gx_forward_set_graphics_type_tag); fill_dev_proc(dev, strip_copy_rop2, gx_forward_strip_copy_rop2); fill_dev_proc(dev, strip_tile_rect_devn, gx_forward_strip_tile_rect_devn); + fill_dev_proc(dev, strip_tile_rect_devn, gx_forward_strip_tile_rect_devn); fill_dev_proc(dev, transform_pixel_region, gx_forward_transform_pixel_region); + fill_dev_proc(dev, fill_stroke_path, gx_forward_fill_stroke_path); gx_device_fill_in_procs((gx_device *) dev); } @@ -449,6 +451,24 @@ gx_forward_stroke_path(gx_device * dev, const gs_gstate * pgs, return proc(tdev, pgs, ppath, params, pdcolor, pcpath); } +int +gx_forward_fill_stroke_path(gx_device * dev, const gs_gstate * pgs, + gx_path * ppath, + const gx_fill_params * params_fill, + const gx_drawing_color * pdcolor_fill, + const gx_stroke_params * params_stroke, + const gx_drawing_color * pdcolor_stroke, + const gx_clip_path * pcpath) +{ + gx_device_forward * const fdev = (gx_device_forward *)dev; + gx_device *tdev = fdev->target; + dev_proc_fill_stroke_path((*proc)) = + (tdev == 0 ? (tdev = dev, gx_default_fill_stroke_path) : + dev_proc(tdev, fill_stroke_path)); + + return proc(tdev, pgs, ppath, params_fill, pdcolor_fill, params_stroke, pdcolor_stroke, pcpath); +} + int gx_forward_fill_mask(gx_device * dev, const byte * data, int dx, int raster, gx_bitmap_id id, -- cgit v1.2.1