summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2020-01-03 14:35:51 -0800
committerMichael Vrhel <michael.vrhel@artifex.com>2020-01-10 09:37:33 -0800
commitaa669c2e1527230762c30c05467841f83bca194d (patch)
tree3d91db7d87cf0824033842a3cf61fcdc815fec91
parent96bec4be3dba8eabd85a100a3c6023ca8f9949c6 (diff)
downloadghostpdl-aa669c2e1527230762c30c05467841f83bca194d.tar.gz
When knockout group pushed in strokefill allow alpha=0
When alpha of the fill and the stroke dont match we push a knockout group. We need to draw the stroke or the fill even if its alpha is zero. Bug 692242
-rw-r--r--base/gdevp14.c60
1 files changed, 28 insertions, 32 deletions
diff --git a/base/gdevp14.c b/base/gdevp14.c
index 17c540046..3f8670543 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -3347,7 +3347,7 @@ pdf14_fill_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
} else {
/* Push a non-isolated knockout group. Do not change the alpha or
- blend modes */
+ blend modes. Note: we need to draw those that have alpha = 0 */
params.Isolated = false;
params.group_color = UNKNOWN;
params.Knockout = true;
@@ -3370,38 +3370,34 @@ pdf14_fill_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_path *ppath,
if (code < 0)
goto cleanup;
- if (pgs->fillconstantalpha > 0.0) {
- code = gs_setopacityalpha((gs_gstate*) pgs, pgs->fillconstantalpha);
- if (code < 0)
- goto cleanup;
- ((pdf14_device*)dev)->op_state = PDF14_OP_STATE_FILL;
-
- /* If we are in an overprint situation, set the blend mode to compatible
- overprint */
- if (pgs->overprint)
- code = gs_setblendmode((gs_gstate*) pgs, BLEND_MODE_CompatibleOverprint);
- code = pdf14_fill_path(dev, pgs, ppath, fill_params, pdcolor_fill, pcpath);
- if (pgs->overprint)
- code = gs_setblendmode((gs_gstate*) pgs, blend_mode);
- if (code < 0)
- goto cleanup;
- }
+ code = gs_setopacityalpha((gs_gstate*) pgs, pgs->fillconstantalpha);
+ if (code < 0)
+ goto cleanup;
+ ((pdf14_device*)dev)->op_state = PDF14_OP_STATE_FILL;
+
+ /* If we are in an overprint situation, set the blend mode to compatible
+ overprint */
+ if (pgs->overprint)
+ code = gs_setblendmode((gs_gstate*) pgs, BLEND_MODE_CompatibleOverprint);
+ code = pdf14_fill_path(dev, pgs, ppath, fill_params, pdcolor_fill, pcpath);
+ if (pgs->overprint)
+ code = gs_setblendmode((gs_gstate*) pgs, blend_mode);
+ if (code < 0)
+ goto cleanup;
- if (pgs->strokeconstantalpha > 0.0) {
- code = gs_setopacityalpha((gs_gstate*) pgs, pgs->strokeconstantalpha);
- if (code < 0)
- goto cleanup;
- gs_swapcolors_quick((gs_gstate*) pgs);
- ((pdf14_device*)dev)->op_state = PDF14_OP_STATE_STROKE;
- if (pgs->stroke_overprint)
- code = gs_setblendmode((gs_gstate*) pgs, BLEND_MODE_CompatibleOverprint);
- code = pdf14_stroke_path(dev, pgs, ppath, stroke_params, pdcolor_stroke, pcpath);
- if (pgs->stroke_overprint)
- code = gs_setblendmode((gs_gstate*) pgs, blend_mode);
- gs_swapcolors_quick((gs_gstate*) pgs);
- if (code < 0)
- goto cleanup; /* bail out (with colors swapped back to fill) */
- }
+ code = gs_setopacityalpha((gs_gstate*) pgs, pgs->strokeconstantalpha);
+ if (code < 0)
+ goto cleanup;
+ gs_swapcolors_quick((gs_gstate*) pgs);
+ ((pdf14_device*)dev)->op_state = PDF14_OP_STATE_STROKE;
+ if (pgs->stroke_overprint)
+ code = gs_setblendmode((gs_gstate*) pgs, BLEND_MODE_CompatibleOverprint);
+ code = pdf14_stroke_path(dev, pgs, ppath, stroke_params, pdcolor_stroke, pcpath);
+ if (pgs->stroke_overprint)
+ code = gs_setblendmode((gs_gstate*) pgs, blend_mode);
+ gs_swapcolors_quick((gs_gstate*) pgs);
+ if (code < 0)
+ goto cleanup; /* bail out (with colors swapped back to fill) */
}
/* Now during the pop do the compositing with alpha of 1.0 and normal blend */