diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2021-04-28 20:34:17 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2021-05-03 12:05:05 +0100 |
commit | 2b5118c3fcb8e5cc58c9a3d87ad9fe327eece117 (patch) | |
tree | 0bff7932ad9f2ea74d30dfcb33c2b4942005ed92 /base/gxpcmap.c | |
parent | 623be737dbf836d5f037f0071900f645f24cf6cc (diff) | |
download | ghostpdl-2b5118c3fcb8e5cc58c9a3d87ad9fe327eece117.tar.gz |
Remove get_bits in favour of get_bits_rectangle.
Diffstat (limited to 'base/gxpcmap.c')
-rw-r--r-- | base/gxpcmap.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/base/gxpcmap.c b/base/gxpcmap.c index 6458c37d4..1e41b40c8 100644 --- a/base/gxpcmap.c +++ b/base/gxpcmap.c @@ -117,7 +117,6 @@ pattern_accum_initialize_device_procs(gx_device *dev) /* It would be much nicer if gx_device_init set the following * defaults for us, but that doesn't work for some reason. */ - set_dev_proc(dev, get_bits, gx_default_get_bits); set_dev_proc(dev, copy_alpha, gx_default_copy_alpha); set_dev_proc(dev, fill_path, gx_default_fill_path); set_dev_proc(dev, stroke_path, gx_default_stroke_path); @@ -632,6 +631,8 @@ blank_unmasked_bits(gx_device * mask, int code = 0; byte *ptr; int blank = (polarity == GX_CINFO_POLARITY_ADDITIVE ? 255 : 0); + gs_int_rect rect; + gs_get_bits_params_t params; if ((p->options & required_options) != required_options) return_error(gs_error_rangecheck); @@ -640,6 +641,11 @@ blank_unmasked_bits(gx_device * mask, if (min == NULL) return_error(gs_error_VMerror); + rect.p.x = 0; + rect.q.x = mask->width; + params.x_offset = 0; + params.raster = bitmap_raster(mask->width * mask->color_info.depth); + if (p->options & GB_PACKING_CHUNKY) { if ((depth & 7) != 0 || depth > 64) @@ -650,9 +656,20 @@ blank_unmasked_bits(gx_device * mask, for (y = 0; y < h; y++) { byte *mine; - code = dev_proc(mask, get_bits)(mask, y+y0, min, &mine); + + rect.p.y = y+y0; + rect.q.y = y+y0+1; + params.options = (GB_ALIGN_ANY | + (GB_RETURN_COPY | GB_RETURN_POINTER) | + GB_OFFSET_0 | + GB_RASTER_STANDARD | GB_PACKING_CHUNKY | + GB_COLORS_NATIVE | GB_ALPHA_NONE); + params.data[0] = min; + code = (*dev_proc(mask, get_bits_rectangle))(mask, &rect, + ¶ms, NULL); if (code < 0) goto fail; + mine = params.data[0]; for (x = 0; x < w; x++) { int xx = x+x0; @@ -693,9 +710,21 @@ blank_unmasked_bits(gx_device * mask, { int c; byte *mine; - code = dev_proc(mask, get_bits)(mask, y+y0, min, &mine); + + rect.p.y = y+y0; + rect.q.y = y+y0+1; + params.options = (GB_ALIGN_ANY | + (GB_RETURN_COPY | GB_RETURN_POINTER) | + GB_OFFSET_0 | + GB_RASTER_STANDARD | GB_PACKING_CHUNKY | + GB_COLORS_NATIVE | GB_ALPHA_NONE); + params.data[0] = min; + code = (*dev_proc(mask, get_bits_rectangle))(mask, &rect, + ¶ms, NULL); if (code < 0) goto fail; + mine = params.data[0]; + for (c = 0; c < num_comps; c++) { if (p->data[c] == NULL) |