summaryrefslogtreecommitdiff
path: root/base/gsicc_cache.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2022-03-03 11:28:24 +0000
committerRobin Watts <Robin.Watts@artifex.com>2022-03-07 14:53:48 +0000
commit16fdcab836300c9440ab75c92607ef504a978cef (patch)
treed347dc00e13d92960443e1177b251cffc12992b1 /base/gsicc_cache.c
parent2345f9004657b76db451d3e814a9776c603ee62c (diff)
downloadghostpdl-16fdcab836300c9440ab75c92607ef504a978cef.tar.gz
Update plan devices to use the downscaler, plus various fixes.
Specifically this is intended to allow use of -sPostRenderProfile so we can (for example) use the plan device to render in RGB, then convert to cmyk as a post-process step. In preparing this commit, various problems were found in the planar downscaler, and these are fixed here too. In addition, to avoid every device that wants to support PostRenderProfile needing an identical batch of code to create the icclink, we extract that into a gx_downscaler_create_post_render_link helper function, and use that in the appropriate devices. As a knock on for that, we tweak gsicc_free_link. Firstly, it no longer takes a memory pointer, but rather uses the one in the link itself. This is a step up from the existing code that appears to allocate with 'stable_memory' and then free with 'non_gc_memory'. I suspect we've been getting away with this by chance because the two have always happened to be the same. Secondly, it performs the 'free_link' operation as part of the call. This enables all the call sites to be simplified.
Diffstat (limited to 'base/gsicc_cache.c')
-rw-r--r--base/gsicc_cache.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/base/gsicc_cache.c b/base/gsicc_cache.c
index 372cde854..bdf57bde6 100644
--- a/base/gsicc_cache.c
+++ b/base/gsicc_cache.c
@@ -260,10 +260,12 @@ gsicc_alloc_link_dev(gs_memory_t *memory, cmm_profile_t *src_profile,
/* And the related release of the link */
void
-gsicc_free_link_dev(gs_memory_t *memory, gsicc_link_t *link)
+gsicc_free_link_dev(gsicc_link_t *link)
{
- gs_memory_t *nongc_mem = memory->non_gc_memory;
- gs_free_object(nongc_mem, link, "gsicc_free_link_dev");
+ if (link == NULL)
+ return;
+ link->procs.free_link(link);
+ gs_free_object(link->memory, link, "gsicc_free_link_dev");
}
static gsicc_link_t *