summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2020-11-20 15:34:54 +0000
committerRobin Watts <Robin.Watts@artifex.com>2020-11-20 15:38:26 +0000
commite2e50a951f3f06c48d908ea8f095e2d7ae2ee5e9 (patch)
tree75ae8f085101a2cea7a51ae873d352656b7ccbaf /base
parent86ed012049f58ef01d02c18b8f16c6f343be30db (diff)
downloadghostpdl-e2e50a951f3f06c48d908ea8f095e2d7ae2ee5e9.tar.gz
Bug 703161: Fix unknown error when interpolating transparent imagemasks.
Patch from Alex Cherepanov. Add a dev_spec_op to check for whether copy_alpha is disabled or not. Clist devices with transparency disable it. Use this to bolster the decision made in mask_suitable_for_interpolation.
Diffstat (limited to 'base')
-rw-r--r--base/gxclrect.c4
-rw-r--r--base/gxdevsop.h11
-rw-r--r--base/gxiscale.c7
3 files changed, 19 insertions, 3 deletions
diff --git a/base/gxclrect.c b/base/gxclrect.c
index 6f71b61af..d0f81ac4e 100644
--- a/base/gxclrect.c
+++ b/base/gxclrect.c
@@ -599,6 +599,10 @@ clist_dev_spec_op(gx_device *pdev, int dev_spec_op, void *data, int size)
return 1;
if (dev_spec_op == gxdso_pattern_shfill_doesnt_need_path)
return 1;
+ if (dev_spec_op == gxdso_copy_alpha_disabled) {
+ gx_device_clist_writer * const cdev = &((gx_device_clist *)pdev)->writer;
+ return (cdev->disable_mask & clist_disable_copy_alpha) != 0;
+ }
if (dev_spec_op == gxdso_supports_devn
|| dev_spec_op == gxdso_skip_icc_component_validation) {
cmm_dev_profile_t *dev_profile;
diff --git a/base/gxdevsop.h b/base/gxdevsop.h
index e2c6a774e..f85724fae 100644
--- a/base/gxdevsop.h
+++ b/base/gxdevsop.h
@@ -29,7 +29,7 @@
* ioctl is to unix file handles.
*
* Design features of this scheme ensure that:
- * * Devices that support a given call call efficiently implement both
+ * * Devices that support a given call can efficiently implement both
* input and output.
* * Devices that do not support a given call can efficiently refuse it
* (without having to know all the possible calls).
@@ -401,6 +401,15 @@ enum {
* for example).
*/
gxdso_skip_icc_component_validation,
+
+ /* gxdso_copy_alpha_disabled:
+ * data = NULL
+ * size = 0
+ * Returns 1 if the command list device sets clist_disable_copy_alpha flag,
+ * 0 otherwise.
+ */
+ gxdso_copy_alpha_disabled,
+
/* Add new gxdso_ keys above this. */
gxdso_pattern__LAST
};
diff --git a/base/gxiscale.c b/base/gxiscale.c
index df0255d74..f175fd22a 100644
--- a/base/gxiscale.c
+++ b/base/gxiscale.c
@@ -145,10 +145,13 @@ static int mask_suitable_for_interpolation(gx_image_enum *penum)
int code;
int high_level_color = 1;
- if (gx_device_must_halftone(penum->dev)) {
+ if (gx_device_must_halftone(penum->dev))
/* We don't interpolate when going to 1bpp outputs */
return -1;
- } else if (gx_dc_is_pure(pdc1) && (pdc1)->colors.pure != gx_no_color_index &&
+ if (dev_proc(penum->dev, dev_spec_op)(penum->dev, gxdso_copy_alpha_disabled, NULL, 0) == 1)
+ /* The target device has copy_alpha() disabled. */
+ return -1;
+ if (gx_dc_is_pure(pdc1) && (pdc1)->colors.pure != gx_no_color_index &&
dev_proc(penum->dev, copy_alpha) != NULL &&
dev_proc(penum->dev, copy_alpha) != gx_no_copy_alpha) {
/* We have a 'pure' color, and a valid copy_alpha. We can work with that. */