diff options
author | Ray Johnston <ray.johnston@artifex.com> | 2020-01-27 11:05:38 -0800 |
---|---|---|
committer | Ray Johnston <ray.johnston@artifex.com> | 2020-01-28 07:33:16 -0800 |
commit | 85cf3b3a7befbed4811d9460dc6a4637f929f8ab (patch) | |
tree | 2dcf80c422fddca662a897dff35cb8fdc91b83f4 /base/gxicolor.c | |
parent | fe9e85d882ade3ebd55c4da0baf1f10d4bb8542d (diff) | |
download | ghostpdl-85cf3b3a7befbed4811d9460dc6a4637f929f8ab.tar.gz |
Fix bug 702065: Multiple rendering threads run slower.
The image_render_color_DeviceN would remap colors using gx_remap_ICC
which would get the link from the icclink_cache every time. This would
temporarily lock the mutex for the cache which apparently caused delays.
This would only occur in devices that support spot colors, when the page
used transparency due to gx_device_uses_std_cmap_procs returning false in
this case.
The change refactors gx_remap_ICC to produce gx_remap_ICC_with_link that
can be used by image_render_color_DeviceN with an icc_link that is retained
in the image enum. The gs_image_class_4_color function is changed to get the
icc_link for the image_enum before checking the for std cmap procs so that
it will be available during image_render_color_DeviceN.
Diffstat (limited to 'base/gxicolor.c')
-rw-r--r-- | base/gxicolor.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/base/gxicolor.c b/base/gxicolor.c index 05e28a345..4800af1aa 100644 --- a/base/gxicolor.c +++ b/base/gxicolor.c @@ -164,7 +164,6 @@ static int image_skip_color_icc_tpr(gx_image_enum *penum, gx_device *dev); int gs_image_class_4_color(gx_image_enum * penum, irender_proc_t *render_fn) { - bool std_cmap_procs; int code = 0; #if USE_FAST_HT_CODE bool use_fast_thresh = true; @@ -213,12 +212,10 @@ gs_image_class_4_color(gx_image_enum * penum, irender_proc_t *render_fn) then we will need to use those and go through pixel by pixel instead of blasting through buffers. This is true for example with many of the color spaces for CUPs */ - std_cmap_procs = gx_device_uses_std_cmap_procs(penum->dev, penum->pgs); if ( (gs_color_space_get_index(penum->pcs) == gs_color_space_index_DeviceN && - penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color || - !std_cmap_procs) { + penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color) { *render_fn = &image_render_color_DeviceN; - return code; + return 0; } /* Set up the link now */ @@ -271,6 +268,10 @@ gs_image_class_4_color(gx_image_enum * penum, irender_proc_t *render_fn) penum->use_cie_range = (get_cie_range(penum->pcs) != NULL); } } + if (!gx_device_uses_std_cmap_procs(penum->dev, penum->pgs)) { + *render_fn = &image_render_color_DeviceN; + return code; + } if (gx_device_must_halftone(penum->dev) && use_fast_thresh && (penum->posture == image_portrait || penum->posture == image_landscape) && penum->image_parent_type == gs_image_type1) { @@ -1200,8 +1201,12 @@ image_render_color_DeviceN(gx_image_enum *penum_orig, const byte *buffer, int da dmputs(dev->memory, "\n"); } #endif - mcode = remap_color(&cc, pcs, pdevc_next, pgs, dev, - gs_color_select_source); + if (lab_case || penum->icc_link == NULL || pcs->cmm_icc_profile_data == NULL) + mcode = remap_color(&cc, pcs, pdevc_next, pgs, dev, gs_color_select_source); + else + mcode = gx_remap_ICC_with_link(&cc, pcs, pdevc_next, pgs, dev, + gs_color_select_source, penum->icc_link); + mapped: if (mcode < 0) goto fill; if (sizeof(pdevc_next->colors.binary.color[0]) <= sizeof(ulong)) |