summaryrefslogtreecommitdiff
path: root/cups
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2021-06-10 14:38:27 +0100
committerRobin Watts <Robin.Watts@artifex.com>2021-06-16 13:21:54 +0100
commitf3aaf279fff916a2ce8865ae940e32a724fcf5f3 (patch)
tree76f08f49e5f807c707b058e0ca9405be315ee2c0 /cups
parentb08ddcae269aa0804909fc80fc671519e7d8ff75 (diff)
downloadghostpdl-f3aaf279fff916a2ce8865ae940e32a724fcf5f3.tar.gz
Change get_color_mapping_procs device procedure.
Previously, devices would call 'get_color_mapping_procs' to get a procedure table from a device. They would then call those procs, passing in the device as an argument. For forwarding/subclassing devices, this is problematic, because getting a child device's color_mapping_procs, and passing it a parent's device pointer will lead to failures. Accordingly lots of wrapping functions have to be written. Here we try an alternative formulation. When we 'get_color_mapping_procs' we get both the procedure table, and the device pointer to pass to them. For most devices this will be the incoming device pointer parrotted back. For forwarding and subclass devices, it will be the appropriate child device.
Diffstat (limited to 'cups')
-rw-r--r--cups/gdevcups.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cups/gdevcups.c b/cups/gdevcups.c
index cdc43fd89..a9dbc1424 100644
--- a/cups/gdevcups.c
+++ b/cups/gdevcups.c
@@ -797,9 +797,10 @@ cups_get_color_comp_index(gx_device * pdev, const char * pname,
*/
private const gx_cm_color_map_procs * /* O - List of device procedures */
-cups_get_color_mapping_procs(const gx_device *pdev)
+cups_get_color_mapping_procs(const gx_device *pdev, const gx_device **tdev)
/* I - Device info */
{
+ *tdev = pdev;
return (&cups_color_mapping_procs);
}
#endif /* dev_t_proc_encode_color */
@@ -1192,7 +1193,7 @@ cups_map_cielab(double x, /* I - Raw color value */
*/
private void
-cups_map_cmyk(gx_device *pdev, /* I - Device info */
+cups_map_cmyk(const gx_device *pdev, /* I - Device info */
frac c, /* I - Cyan value */
frac m, /* I - Magenta value */
frac y, /* I - Yellow value */
@@ -1661,7 +1662,7 @@ cups_map_cmyk(gx_device *pdev, /* I - Device info */
*/
private void
-cups_map_gray(gx_device *pdev, /* I - Device info */
+cups_map_gray(const gx_device *pdev, /* I - Device info */
frac g, /* I - Grayscale value */
frac *out) /* O - Device colors */
{
@@ -1683,7 +1684,7 @@ cups_map_gray(gx_device *pdev, /* I - Device info */
*/
private void
-cups_map_rgb(gx_device *pdev,
+cups_map_rgb(const gx_device *pdev,
/* I - Device info */
const gs_gstate *pgs,/* I - Device state */
frac r, /* I - Red value */