diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2021-10-21 18:31:05 -0700 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2021-10-22 08:48:09 -0700 |
commit | 2594c15201e796759f095d70ba747d0e56e5c318 (patch) | |
tree | df76395dc42419f52bb139553128018f6ed02366 | |
parent | 7902518d3e219c719c74297ea5520080a55e73f8 (diff) | |
download | ghostpdl-2594c15201e796759f095d70ba747d0e56e5c318.tar.gz |
Bug704638 Overprint, softmask, normal blend, spot colors
The group that we push for dealing with the softmask should
not be isolated if we have a normal blend case.
-rw-r--r-- | Resource/Init/pdf_ops.ps | 3 | ||||
-rw-r--r-- | pdf/pdf_trans.c | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Resource/Init/pdf_ops.ps b/Resource/Init/pdf_ops.ps index 27c206808..7afaefeb5 100644 --- a/Resource/Init/pdf_ops.ps +++ b/Resource/Init/pdf_ops.ps @@ -716,7 +716,8 @@ end //false } ifelse .currentSMask //null ne or { % push a group for OP or SMask - mark /Subtype /Group /Isolated .currentSMask //null ne .dicttomark + % It should only be isolated if there is a softmask and the blend mode is not normal (or compatible) + mark /Subtype /Group /Isolated .currentSMask //null ne .currentblendmode /Normal ne and .currentblendmode /Compatible ne and .dicttomark 2 index aload pop % pathbbox .begintransparencygroup % After group pushed, set alphas and blendmode diff --git a/pdf/pdf_trans.c b/pdf/pdf_trans.c index 71ff2f676..80e03c154 100644 --- a/pdf/pdf_trans.c +++ b/pdf/pdf_trans.c @@ -707,10 +707,17 @@ int pdfi_trans_setup(pdf_context *ctx, pdfi_trans_state_t *state, gs_rect *bbox, /* TODO: error handling... */ if (need_group) { + bool isolated = false; + mode = gs_currentblendmode(ctx->pgs); + stroked_bbox = (caller == TRANSPARENCY_Caller_Stroke || caller == TRANSPARENCY_Caller_FillStroke); + /* When changing to compatible overprint bm, the group pushed must be non-isolated. The exception - is if we have a softmask. See /setupOPtrans in pdf_ops.ps */ - code = pdfi_trans_begin_simple_group(ctx, bbox, stroked_bbox, igs->SMask != NULL, false); + is if we have a softmask AND the blend mode is not normal and not compatible. + See /setupOPtrans in pdf_ops.ps */ + if (igs->SMask != NULL && mode != BLEND_MODE_Normal && mode != BLEND_MODE_Compatible) + isolated = true; + code = pdfi_trans_begin_simple_group(ctx, bbox, stroked_bbox, isolated, false); state->GroupPushed = true; state->saveStrokeAlpha = gs_getstrokeconstantalpha(ctx->pgs); state->saveFillAlpha = gs_getfillconstantalpha(ctx->pgs); |