summaryrefslogtreecommitdiff
path: root/gs/base/gxcht.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-09-29 16:03:06 +0100
committerRobin Watts <Robin.Watts@artifex.com>2011-09-29 16:14:28 +0100
commit9b60dc77805746ca685e272abe9b3f056320d612 (patch)
tree4437b22125b7bf088e5150913f411f11a7f77368 /gs/base/gxcht.c
parentd4741818da0a3f9a5a7ab98c328795dde6f850cb (diff)
Partial fix for planar device pattern rop problems.
plank vs pamcmyk4 tests have revealed various files still rendering wrongly in plank format. These are to do with a halftone being rendered as a pattern and then used as part of a rop. Specifically, if the 'rop source' device is used, then it is fed a pattern tile that is in planar format. When this calls strip_copy_rop, the pattern tiles data is used as the 'T' field; strip_copy_rop assumes that both T and S are always in chunky format, and so garbage is read for the T plane. The fix, implemented here, is to spot that the pattern tile is planar, and to set a new bit (lop_t_is_planar) in the lop to indicate this fact. The planar device can then catch this bit and can handle it. Currently, this is implemented by doing a planar_to_chunky operation into a temporary buffer, performing the strip_copy_rop, and then freeing the buffer. Later we may well implement cores that can cope with the common cases with T being still in planar form. This commit only fixes unbanded operation; currently when the clist writer puts the tile into the clist, it has no way of indicating that the tile is in planar format, hence only writes 1/4 of the data. I need to talk to Ray and Michael about this. This is broken already, so this commit shouldn't make anything worse. I have updated the docs (out of date since 1998, at least) in related areas, and fixed some broken english.
Diffstat (limited to 'gs/base/gxcht.c')
-rw-r--r--gs/base/gxcht.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gs/base/gxcht.c b/gs/base/gxcht.c
index c6b9f90b4..9716c4679 100644
--- a/gs/base/gxcht.c
+++ b/gs/base/gxcht.c
@@ -26,6 +26,7 @@
#include "gxistate.h"
#include "gzht.h"
#include "gsserial.h"
+#include "gxdevsop.h"
/* Define whether to force use of the slow code, for testing. */
#define USE_SLOW_CODE 0
@@ -583,8 +584,7 @@ gx_dc_ht_colored_fill_rectangle(const gx_device_color * pdevc,
#if USE_SLOW_CODE
set_ht_colors_gt_4
#else
- (dev_proc(dev, map_cmyk_color) == gx_default_encode_color &&
- dev->color_info.depth == 4) ?
+ (dev_proc(dev, dev_spec_op)(dev, gxdso_is_std_cmyk_1bit, NULL, 0) > 0) ?
set_cmyk_1bit_colors :
nplanes <= 4 ? set_ht_colors_le_4 :
set_ht_colors_gt_4