diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2013-08-13 00:04:57 -0700 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2013-08-13 21:42:19 -0700 |
commit | b89761f06d297f8555f346e9c0a7850fc549c668 (patch) | |
tree | 37bd0e81816cee1e12ad822adce4459b3c578e5e /gs/base/gxblend1.c | |
parent | 6c7d9d1191ed4afad16f7bc4089a43bb18190a96 (diff) | |
download | ghostpdl-b89761f06d297f8555f346e9c0a7850fc549c668.tar.gz |
Fix for problem with double application of alpha when composing isolated groups.
Diffstat (limited to 'gs/base/gxblend1.c')
-rw-r--r-- | gs/base/gxblend1.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gs/base/gxblend1.c b/gs/base/gxblend1.c index 481345ecf..b7c7eb42f 100644 --- a/gs/base/gxblend1.c +++ b/gs/base/gxblend1.c @@ -306,12 +306,24 @@ pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf, } else { in_mask_rect = false; } - if (in_mask_rect || maskbuf == NULL) - pix_alpha = alpha; - else - pix_alpha = mask_bg_alpha; - /* Complement the components for subtractive color spaces */ + pix_alpha = alpha; + /* If we have a soft mask, then we have some special handling of the + group alpha value */ + if (has_mask) { + if (!in_mask_rect) { + /* Special case where we have a soft mask but are outside the + range of the soft mask and must use the background alpha value */ + pix_alpha = mask_bg_alpha; + } else { + /* If we are isolated, do not double apply the alpha */ + if (tos_isolated) { + pix_alpha = 0xff; + } + } + } + + /* Complement the components for subtractive color spaces */ if (additive) { for (i = 0; i <= n_chan; ++i) { tos_pixel[i] = tos_ptr[i * tos_planestride]; |