summaryrefslogtreecommitdiff
path: root/gs/base/gdevdrop.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/gdevdrop.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/gdevdrop.c')
-rw-r--r--gs/base/gdevdrop.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gs/base/gdevdrop.c b/gs/base/gdevdrop.c
index a6ff9351b..45e0708cc 100644
--- a/gs/base/gdevdrop.c
+++ b/gs/base/gdevdrop.c
@@ -544,6 +544,11 @@ mem_default_strip_copy_rop(gx_device * dev,
GB_COLORS_NATIVE | GB_ALPHA_NONE | GB_DEPTH_ALL |
GB_PACKING_CHUNKY | GB_RETURN_ALL | GB_ALIGN_STANDARD |
GB_OFFSET_0 | GB_OFFSET_ANY | GB_RASTER_STANDARD;
+ const gx_bitmap_format_t no_expand_t_options =
+ GB_COLORS_NATIVE | GB_ALPHA_NONE | GB_DEPTH_ALL |
+ GB_RETURN_ALL | GB_ALIGN_STANDARD |
+ GB_OFFSET_0 | GB_OFFSET_ANY | GB_RASTER_STANDARD |
+ ((lop & lop_t_is_planar) ? GB_PACKING_PLANAR : GB_PACKING_CHUNKY);
const gx_bitmap_format_t expand_options =
(rop_depth > 8 ? GB_COLORS_RGB : GB_COLORS_GRAY) |
GB_ALPHA_NONE | GB_DEPTH_8 |
@@ -578,6 +583,7 @@ mem_default_strip_copy_rop(gx_device * dev,
gs_get_bits_params_t bit_params;
gs_get_bits_params_t expand_params;
gs_get_bits_params_t no_expand_params;
+ gs_get_bits_params_t no_expand_t_params;
int max_height;
int block_height, loop_height;
int code;
@@ -637,6 +643,7 @@ mem_default_strip_copy_rop(gx_device * dev,
expand_s = scolors == 0 && uses_s;
expand_t = tcolors == 0 && uses_t;
no_expand_params.options = no_expand_options;
+ no_expand_t_params.options = no_expand_t_options;
if (expand_t) {
/*
* We don't want to wrap around more than once in Y when
@@ -710,7 +717,7 @@ mem_default_strip_copy_rop(gx_device * dev,
rect.q.y = py + loop_height;
expand_params.data[0] = texture_row;
gx_get_bits_copy(dev, 0, textures->rep_width, loop_height,
- &expand_params, &no_expand_params,
+ &expand_params, &no_expand_t_params,
textures->data + rep_y * textures->raster,
textures->raster);
/*