diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2017-09-19 10:41:21 -0700 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2017-09-28 11:34:04 +0100 |
commit | cc966e7f9029c27abc896431a3c4910b40d915ef (patch) | |
tree | 8c224dfd129cd73d17251bbcad63e670421eb7b5 | |
parent | c03add9e9caaa4958928f74a6ca4f2b71915063c (diff) | |
download | ghostpdl-cc966e7f9029c27abc896431a3c4910b40d915ef.tar.gz |
Bug 698559 avoid double alpha application
When we have a softmask present in the graphic state, we
wrap up the fill or stroke with an isolated transparency
group in the interpreter. After the group is pushed we
should set the opacityalpha and the shapealpha to 1 to
avoid a double application of alpha at the rect-fill level and
the group composition level.
-rw-r--r-- | Resource/Init/pdf_ops.ps | 4 | ||||
-rw-r--r-- | base/gxblend1.c | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/Resource/Init/pdf_ops.ps b/Resource/Init/pdf_ops.ps index e3751bc91..10058b8b1 100644 --- a/Resource/Init/pdf_ops.ps +++ b/Resource/Init/pdf_ops.ps @@ -629,6 +629,8 @@ end def PDFusingtransparency { .currentSMask //null ne { mark /Subtype /Group /Isolated //true .dicttomark pathbbox .begintransparencygroup + exch .currentshapealpha exch .currentopacityalpha exch 4 -1 roll % avoid double application + 1 .setopacityalpha 1 .setshapealpha } if dup checkOPtrans exch 1 index { % We need to push a non-isolated, non-knockout transparency group and @@ -643,7 +645,7 @@ end def .endtransparencygroup .setopacityalpha .setblendmode % end the CompatibleOverprint group } if .currentSMask //null ne { - .endtransparencygroup + .endtransparencygroup .setshapealpha .setopacityalpha } if } { cvx exec diff --git a/base/gxblend1.c b/base/gxblend1.c index 146d5f5bc..b720a755a 100644 --- a/base/gxblend1.c +++ b/base/gxblend1.c @@ -429,11 +429,6 @@ pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf, pix_alpha = mask_bg_alpha; matte_alpha = 0xff; } else { - /* If we are isolated, do not double apply the alpha */ - if (tos_isolated) - pix_alpha = 0xff; - /* If we have a matte entry (pre-multiplied) then get - the mask alpha so we can undo for proper blending */ if (has_matte) matte_alpha = mask_tr_fn[*mask_curr_ptr]; } |