diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2021-06-30 15:26:09 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2021-07-01 00:27:56 +0100 |
commit | 8e1859c5fa8ff7af476e8317f8efc3f762c935cc (patch) | |
tree | 97523332af4d8e149437e3991d1fcb2b4b117570 | |
parent | 2f7f448a4b73b8f996fa9196527da1db5cc520e2 (diff) | |
download | ghostpdl-8e1859c5fa8ff7af476e8317f8efc3f762c935cc.tar.gz |
Remove "unread" param from get_bits_rectangle.
No one sets it. No one reads it. It's pointless, so excise it.
-rw-r--r-- | base/gdevdbit.c | 4 | ||||
-rw-r--r-- | base/gdevdgbr.c | 4 | ||||
-rw-r--r-- | base/gdevdrop.c | 4 | ||||
-rw-r--r-- | base/gdevepo.c | 4 | ||||
-rw-r--r-- | base/gdevflp.c | 6 | ||||
-rw-r--r-- | base/gdevmem.c | 9 | ||||
-rw-r--r-- | base/gdevmpla.c | 6 | ||||
-rw-r--r-- | base/gdevmrun.c | 4 | ||||
-rw-r--r-- | base/gdevnfwd.c | 4 | ||||
-rw-r--r-- | base/gdevp14.c | 2 | ||||
-rw-r--r-- | base/gdevplnx.c | 12 | ||||
-rw-r--r-- | base/gdevprn.c | 6 | ||||
-rw-r--r-- | base/gdevsclass.c | 6 | ||||
-rw-r--r-- | base/gsdevice.c | 2 | ||||
-rw-r--r-- | base/gsovrc.c | 4 | ||||
-rw-r--r-- | base/gxclip.c | 18 | ||||
-rw-r--r-- | base/gxclread.c | 11 | ||||
-rw-r--r-- | base/gxclthrd.c | 14 | ||||
-rw-r--r-- | base/gxdevcli.h | 2 | ||||
-rw-r--r-- | base/gxdownscale.c | 8 | ||||
-rw-r--r-- | base/gxoprect.c | 9 | ||||
-rw-r--r-- | base/gxpcmap.c | 8 | ||||
-rw-r--r-- | devices/gdevcmykog.c | 2 | ||||
-rw-r--r-- | devices/gdevdsp.c | 7 | ||||
-rw-r--r-- | devices/gdevfpng.c | 2 | ||||
-rw-r--r-- | devices/gdevplan.c | 4 | ||||
-rw-r--r-- | devices/gdevplib.c | 8 | ||||
-rw-r--r-- | devices/gdevpng.c | 2 | ||||
-rw-r--r-- | devices/gdevtsep.c | 2 | ||||
-rw-r--r-- | devices/gdevupd.c | 2 | ||||
-rw-r--r-- | devices/gdevx.c | 63 | ||||
-rw-r--r-- | devices/gdevxalt.c | 8 | ||||
-rw-r--r-- | devices/vector/gdevpsdu.c | 3 | ||||
-rw-r--r-- | doc/Drivers.htm | 21 | ||||
-rw-r--r-- | psi/zdevice.c | 2 |
35 files changed, 87 insertions, 186 deletions
diff --git a/base/gdevdbit.c b/base/gdevdbit.c index dbe893876..a04e0b33a 100644 --- a/base/gdevdbit.c +++ b/base/gdevdbit.c @@ -226,7 +226,7 @@ gx_default_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x, gb_params.data[j] = 0; gb_params.data[k] = gb_buff + k * out_raster; code = dev_proc(dev, get_bits_rectangle) (dev, &gb_rect, - &gb_params, 0); + &gb_params); src_planes[k] = gb_params.data[k]; if (code < 0) { gs_free_object(mem, gb_buff, "copy_alpha_hl_color"); @@ -390,7 +390,7 @@ gx_default_copy_alpha(gx_device * dev, const byte * data, int data_x, rect.p.y = ry; rect.q.y = ry+1; code = (*dev_proc(dev, get_bits_rectangle))(dev, &rect, - ¶ms, NULL); + ¶ms); if (code < 0) break; line = params.data[0]; diff --git a/base/gdevdgbr.c b/base/gdevdgbr.c index c5922e3c1..c23762027 100644 --- a/base/gdevdgbr.c +++ b/base/gdevdgbr.c @@ -487,13 +487,13 @@ gx_get_bits_native_to_std(gx_device * dev, int x, int w, int h, int gx_default_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) + gs_get_bits_params_t * params) { return_error(gs_error_unknownerror); } int gx_blank_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, - gs_get_bits_params_t *params, gs_int_rect **unread) + gs_get_bits_params_t *params) { int supported = GB_COLORS_NATIVE | GB_ALPHA_NONE | diff --git a/base/gdevdrop.c b/base/gdevdrop.c index b2c1234f8..7a6ca1d48 100644 --- a/base/gdevdrop.c +++ b/base/gdevdrop.c @@ -189,7 +189,7 @@ gx_default_strip_copy_rop2(gx_device * dev, bit_params.data[0] = row; bit_params.x_offset = 0; code = (*dev_proc(dev, get_bits_rectangle)) - (dev, &rect, &bit_params, NULL); + (dev, &rect, &bit_params); if (code < 0) break; code = (*dev_proc(pmdev, copy_color)) @@ -774,7 +774,7 @@ do_strip_copy_rop(gx_device * dev, bit_params.x_offset = 0; bit_params.raster = mdev.raster; code = (*dev_proc(dev, get_bits_rectangle)) - (dev, &rect, &bit_params, NULL); + (dev, &rect, &bit_params); if (code < 0) break; } diff --git a/base/gdevepo.c b/base/gdevepo.c index 91ae3b932..41afa6f98 100644 --- a/base/gdevepo.c +++ b/base/gdevepo.c @@ -517,13 +517,13 @@ int epo_copy_color(gx_device *dev, const byte *data, int data_x, int raster, gx_ } int epo_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, - gs_get_bits_params_t *params, gs_int_rect **unread) + gs_get_bits_params_t *params) { int code = epo_handle_erase_page(dev); if (code != 0) return code; - return dev_proc(dev, get_bits_rectangle)(dev, prect, params, unread); + return dev_proc(dev, get_bits_rectangle)(dev, prect, params); } int epo_copy_alpha(gx_device *dev, const byte *data, int data_x, diff --git a/base/gdevflp.c b/base/gdevflp.c index c2e59f0c5..b4a393c31 100644 --- a/base/gdevflp.c +++ b/base/gdevflp.c @@ -732,16 +732,16 @@ int flp_begin_typed_image(gx_device *dev, const gs_gstate *pgs, const gs_matrix } int flp_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, - gs_get_bits_params_t *params, gs_int_rect **unread) + gs_get_bits_params_t *params) { int code = SkipPage(dev); if (code < 0) return code; if (!code) - return default_subclass_get_bits_rectangle(dev, prect, params, unread); + return default_subclass_get_bits_rectangle(dev, prect, params); - return gx_default_get_bits_rectangle(dev->child, prect, params, unread); + return gx_default_get_bits_rectangle(dev->child, prect, params); } int flp_composite(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, diff --git a/base/gdevmem.c b/base/gdevmem.c index 59e10bd47..aa47dc95c 100644 --- a/base/gdevmem.c +++ b/base/gdevmem.c @@ -655,7 +655,7 @@ mem_close(gx_device * dev) #define chunk byte int mem_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) + gs_get_bits_params_t * params) { gx_device_memory * const mdev = (gx_device_memory *)dev; gs_get_bits_options_t options = params->options; @@ -751,7 +751,7 @@ mem_swap_byte_rect(byte * base, uint raster, int x, int w, int h, bool store) /* Copy a word-oriented rectangle to the client, swapping bytes as needed. */ int mem_word_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) + gs_get_bits_params_t * params) { gx_device_memory * const mdev = (gx_device_memory *)dev; byte *src; @@ -767,8 +767,7 @@ mem_word_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, if (w <= 0 || h <= 0) { /* * It's easiest to just keep going with an empty rectangle. - * We pass the original rectangle to mem_get_bits_rectangle, - * so unread will be filled in correctly. + * We pass the original rectangle to mem_get_bits_rectangle. */ x = y = w = h = 0; } @@ -780,7 +779,7 @@ mem_word_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, src = scan_line_base(mdev, y); mem_swap_byte_rect(src, dev_raster, bit_x, bit_w, h, false); - code = mem_get_bits_rectangle(dev, prect, params, unread); + code = mem_get_bits_rectangle(dev, prect, params); mem_swap_byte_rect(src, dev_raster, bit_x, bit_w, h, false); return code; } diff --git a/base/gdevmpla.c b/base/gdevmpla.c index d4a75f91c..28c609d8e 100644 --- a/base/gdevmpla.c +++ b/base/gdevmpla.c @@ -2063,8 +2063,7 @@ mem_planar_strip_copy_rop2(gx_device * dev, /* Copy bits back from a planar memory device. */ static int mem_planar_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, - gs_int_rect ** unread) + gs_get_bits_params_t * params) { /* This duplicates most of mem_get_bits_rectangle. Tant pgs. */ gx_device_memory * const mdev = (gx_device_memory *)dev; @@ -2158,8 +2157,7 @@ mem_planar_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, MEM_SAVE_PARAMS(mdev, save); mdev->line_ptrs += mdev->height * plane; MEM_SET_PARAMS(mdev, mdev->planes[plane].depth); - code = mem_get_bits_rectangle(dev, prect, ©_params, - unread); + code = mem_get_bits_rectangle(dev, prect, ©_params); MEM_RESTORE_PARAMS(mdev, save); if (code >= 0) { params->data[plane] = copy_params.data[0]; diff --git a/base/gdevmrun.c b/base/gdevmrun.c index f077f8a96..f143fbd85 100644 --- a/base/gdevmrun.c +++ b/base/gdevmrun.c @@ -354,13 +354,13 @@ run_strip_copy_rop2(gx_device * dev, const byte * sdata, int sourcex, } static int run_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect **unread) + gs_get_bits_params_t * params) { gx_device_run *const rdev = (gx_device_run *)dev; run_standardize(rdev, prect->p.y, prect->q.y - prect->p.y); return rdev->save_procs.get_bits_rectangle((gx_device *)&rdev->md, - prect, params, unread); + prect, params); } /* Finish initializing a line. This is a separate procedure only */ diff --git a/base/gdevnfwd.c b/base/gdevnfwd.c index 97e10b7e1..f761750bc 100644 --- a/base/gdevnfwd.c +++ b/base/gdevnfwd.c @@ -529,7 +529,7 @@ gx_forward_begin_typed_image(gx_device * dev, const gs_gstate * pgs, int gx_forward_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) + gs_get_bits_params_t * params) { gx_device_forward * const fdev = (gx_device_forward *)dev; gx_device *tdev = fdev->target; @@ -537,7 +537,7 @@ gx_forward_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, (tdev == 0 ? (tdev = dev, gx_default_get_bits_rectangle) : dev_proc(tdev, get_bits_rectangle)); - return proc(tdev, prect, params, unread); + return proc(tdev, prect, params); } int diff --git a/base/gdevp14.c b/base/gdevp14.c index 55267590e..3586d1282 100644 --- a/base/gdevp14.c +++ b/base/gdevp14.c @@ -10663,7 +10663,7 @@ pdf14_clist_composite(gx_device * dev, gx_device ** pcdev, rect.p.y = y; rect.q.y = y+1; code = dev_proc(tdev, get_bits_rectangle)((gx_device *)tdev, - &rect, ¶ms, NULL); + &rect, ¶ms); if (code < 0) goto put_accum_error; actual_data = params.data[0]; diff --git a/base/gdevplnx.c b/base/gdevplnx.c index 40f6b5424..60a84139c 100644 --- a/base/gdevplnx.c +++ b/base/gdevplnx.c @@ -1001,7 +1001,7 @@ plane_image_end_image(gx_image_enum_common_t * info, bool draw_last) static int plane_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) + gs_get_bits_params_t * params) { gx_device_plane_extract * const edev = (gx_device_plane_extract *)dev; gx_device * const plane_dev = edev->plane_dev; @@ -1019,11 +1019,11 @@ plane_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, */ if ((options & GB_PACKING_PLANAR) && (options & GB_SELECT_PLANES)) { if (params->data[plane_index] == 0) - return gx_default_get_bits_rectangle(dev, prect, params, unread); + return gx_default_get_bits_rectangle(dev, prect, params); /* If the caller wants any other plane(s), punt. */ for (plane = 0; plane < dev->color_info.num_components; ++plane) if (plane != plane_index && params->data[plane] != 0) - return gx_default_get_bits_rectangle(dev, prect, params, unread); + return gx_default_get_bits_rectangle(dev, prect, params); /* Pass the request on to the plane device. */ plane_params = *params; plane_params.options = @@ -1031,7 +1031,7 @@ plane_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, GB_PACKING_CHUNKY; plane_params.data[0] = params->data[plane_index]; code = dev_proc(plane_dev, get_bits_rectangle) - (plane_dev, prect, &plane_params, unread); + (plane_dev, prect, &plane_params); if (code >= 0) { *params = plane_params; params->options = (params->options & ~GB_PACKING_ALL) | @@ -1069,7 +1069,7 @@ plane_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, (GB_RASTER_STANDARD | GB_RASTER_ANY)); plane_params.raster = gx_device_raster(plane_dev, true); code = dev_proc(plane_dev, get_bits_rectangle) - (plane_dev, prect, &plane_params, unread); + (plane_dev, prect, &plane_params); if (code >= 0) { /* Success, expand the plane into pixels. */ source.data.read = plane_params.data[0]; @@ -1081,6 +1081,6 @@ plane_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, } params->options = (options & ~GB_RETURN_POINTER) | GB_RETURN_COPY; } else - return gx_default_get_bits_rectangle(dev, prect, params, unread); + return gx_default_get_bits_rectangle(dev, prect, params); return code; } diff --git a/base/gdevprn.c b/base/gdevprn.c index e7b38aed0..07980c959 100644 --- a/base/gdevprn.c +++ b/base/gdevprn.c @@ -1578,7 +1578,7 @@ gdev_prn_get_lines(gx_device_printer *pdev, int y, int height, params.x_offset = 0; params.raster = bytes_per_line; code = dev_proc(pdev, get_bits_rectangle) - ((gx_device *)pdev, &rect, ¶ms, NULL); + ((gx_device *)pdev, &rect, ¶ms); if (code < 0 && actual_buffer) { /* * RETURN_POINTER might not be implemented for this @@ -1587,7 +1587,7 @@ gdev_prn_get_lines(gx_device_printer *pdev, int y, int height, params.options &= ~(GB_RETURN_POINTER | GB_RASTER_ALL); params.options |= GB_RETURN_COPY | GB_RASTER_SPECIFIED; code = dev_proc(pdev, get_bits_rectangle) - ((gx_device *)pdev, &rect, ¶ms, NULL); + ((gx_device *)pdev, &rect, ¶ms); } if (code < 0) return code; @@ -1624,7 +1624,7 @@ gdev_prn_get_bits(gx_device_printer * pdev, int y, byte * str, byte ** actual_da params.raster = bitmap_raster(pdev->width * pdev->color_info.depth); params.data[0] = str; code = (*dev_proc(pdev, get_bits_rectangle))((gx_device *)pdev, &rect, - ¶ms, NULL); + ¶ms); if (code < 0) return code; if (actual_data) diff --git a/base/gdevsclass.c b/base/gdevsclass.c index 7f9dd4053..a8d1df1cb 100644 --- a/base/gdevsclass.c +++ b/base/gdevsclass.c @@ -351,12 +351,12 @@ int default_subclass_begin_typed_image(gx_device *dev, const gs_gstate *pgs, con } int default_subclass_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, - gs_get_bits_params_t *params, gs_int_rect **unread) + gs_get_bits_params_t *params) { if (dev->child) - return dev_proc(dev->child, get_bits_rectangle)(dev->child, prect, params, unread); + return dev_proc(dev->child, get_bits_rectangle)(dev->child, prect, params); /* else */ - return gx_default_get_bits_rectangle(dev, prect, params, unread); + return gx_default_get_bits_rectangle(dev, prect, params); } int default_subclass_composite(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, diff --git a/base/gsdevice.c b/base/gsdevice.c index ab5836414..1da7135a3 100644 --- a/base/gsdevice.c +++ b/base/gsdevice.c @@ -257,7 +257,7 @@ gs_copyscanlines(gx_device * dev, int start_y, byte * data, uint size, GB_RASTER_STANDARD | GB_PACKING_CHUNKY | GB_COLORS_NATIVE | GB_ALPHA_NONE); params.data[0] = dest; - code = (*dev_proc(dev, get_bits_rectangle))(dev, &rect, ¶ms, NULL); + code = (*dev_proc(dev, get_bits_rectangle))(dev, &rect, ¶ms); if (code < 0) { /* Might just be an overrun. */ if (start_y + i == dev->height) diff --git a/base/gsovrc.c b/base/gsovrc.c index 8c3e361bc..745ebfbe9 100644 --- a/base/gsovrc.c +++ b/base/gsovrc.c @@ -984,7 +984,7 @@ overprint_copy_planes(gx_device * dev, const byte * data, int data_x, int raster gb_params.data[j] = 0; gb_params.data[k] = gb_buff + k * raster; code = dev_proc(tdev, get_bits_rectangle) (tdev, &gb_rect, - &gb_params, 0); + &gb_params); if (code < 0) { gs_free_object(mem, gb_buff, "overprint_copy_planes" ); return code; @@ -1108,7 +1108,7 @@ overprint_fill_rectangle_hl_color(gx_device *dev, gb_params.data[j] = 0; gb_params.data[k] = gb_buff + k * raster; code = dev_proc(tdev, get_bits_rectangle) (tdev, &gb_rect, - &gb_params, 0); + &gb_params); if (code < 0) { gs_free_object(mem, gb_buff, "overprint_fill_rectangle_hl_color" ); diff --git a/base/gxclip.c b/base/gxclip.c index c9bf79133..3cad4695a 100644 --- a/base/gxclip.c +++ b/base/gxclip.c @@ -1437,29 +1437,17 @@ clip_get_clipping_box(gx_device * dev, gs_fixed_rect * pbox) /* Get bits back from the device. */ static int clip_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) + gs_get_bits_params_t * params) { gx_device_clip *rdev = (gx_device_clip *) dev; gx_device *tdev = rdev->target; int tx = rdev->translation.x, ty = rdev->translation.y; gs_int_rect rect; - int code; rect.p.x = prect->p.x - tx, rect.p.y = prect->p.y - ty; rect.q.x = prect->q.x - tx, rect.q.y = prect->q.y - ty; - code = (*dev_proc(tdev, get_bits_rectangle)) - (tdev, &rect, params, unread); - if (code > 0) { - /* Adjust unread rectangle coordinates */ - gs_int_rect *list = *unread; - int i; - - for (i = 0; i < code; ++list, ++i) { - list->p.x += tx, list->p.y += ty; - list->q.x += tx, list->q.y += ty; - } - } - return code; + return (*dev_proc(tdev, get_bits_rectangle)) + (tdev, &rect, params); } static int diff --git a/base/gxclread.c b/base/gxclread.c index 2323b68c4..23b07ac3c 100644 --- a/base/gxclread.c +++ b/base/gxclread.c @@ -590,7 +590,7 @@ clist_render_init(gx_device_clist *dev) /* Copy a rasterized rectangle to the client, rasterizing if needed. */ int clist_get_bits_rectangle(gx_device *dev, const gs_int_rect * prect, - gs_get_bits_params_t *params, gs_int_rect **unread) + gs_get_bits_params_t *params) { gx_device_clist *cldev = (gx_device_clist *)dev; gx_device_clist_reader *crdev = &cldev->reader; @@ -631,8 +631,7 @@ clist_get_bits_rectangle(gx_device *dev, const gs_int_rect * prect, for (i = 0; i < num_planes; ++i) if (params->data[i]) { if (plane_index >= 0) /* >1 plane requested */ - return gx_default_get_bits_rectangle(dev, prect, params, - unread); + return gx_default_get_bits_rectangle(dev, prect, params); plane_index = i; } } @@ -655,7 +654,7 @@ clist_get_bits_rectangle(gx_device *dev, const gs_int_rect * prect, band_rect.p.y = my; band_rect.q.y = my + lines_rasterized; code = dev_proc(bdev, get_bits_rectangle) - (bdev, &band_rect, params, unread); + (bdev, &band_rect, params); } cdev->buf_procs.destroy_buf_device(bdev); if (code < 0 || lines_rasterized == line_count) @@ -668,7 +667,7 @@ clist_get_bits_rectangle(gx_device *dev, const gs_int_rect * prect, * rectangles, punt. */ if (!(options & GB_RETURN_COPY) || code > 0) - return gx_default_get_bits_rectangle(dev, prect, params, unread); + return gx_default_get_bits_rectangle(dev, prect, params); options = params->options; if (!(options & GB_RETURN_COPY)) { /* Redo the first piece with copying. */ @@ -703,7 +702,7 @@ clist_get_bits_rectangle(gx_device *dev, const gs_int_rect * prect, band_rect.p.y = my; band_rect.q.y = my + lines_rasterized; code = dev_proc(bdev, get_bits_rectangle) - (bdev, &band_rect, &band_params, unread); + (bdev, &band_rect, &band_params); if (code < 0) break; params->options = options = band_params.options; diff --git a/base/gxclthrd.c b/base/gxclthrd.c index 088de2bfc..a5835cc10 100644 --- a/base/gxclthrd.c +++ b/base/gxclthrd.c @@ -837,7 +837,7 @@ clist_get_band_from_thread(gx_device *dev, int band_needed, gx_process_page_opti /* rendering adjacent to the first band (forward or backward) */ static int clist_get_bits_rect_mt(gx_device *dev, const gs_int_rect * prect, - gs_get_bits_params_t *params, gs_int_rect **unread) + gs_get_bits_params_t *params) { gx_device_printer *pdev = (gx_device_printer *)dev; gx_device_clist *cldev = (gx_device_clist *)dev; @@ -861,7 +861,7 @@ clist_get_bits_rect_mt(gx_device *dev, const gs_int_rect * prect, /* This page might not want multiple threads */ /* Also we don't support plane extraction using multiple threads */ if (pdev->num_render_threads_requested < 1 || (options & GB_SELECT_PLANES)) - return clist_get_bits_rectangle(dev, prect, params, unread); + return clist_get_bits_rectangle(dev, prect, params); if (prect->p.x < 0 || prect->q.x > dev->width || y < 0 || end_y > dev->height @@ -878,12 +878,12 @@ clist_get_bits_rect_mt(gx_device *dev, const gs_int_rect * prect, /* Haven't done any rendering yet, try to set up the threads */ if (clist_setup_render_threads(dev, y, NULL) < 0) /* problem setting up the threads, revert to single threaded */ - return clist_get_bits_rectangle(dev, prect, params, unread); + return clist_get_bits_rectangle(dev, prect, params); } else { if (crdev->render_threads == NULL) { /* If we get here with with ymin and ymax > 0 it's because we closed the threads */ /* while doing a page due to an error. Use single threaded mode. */ - return clist_get_bits_rectangle(dev, prect, params, unread); + return clist_get_bits_rectangle(dev, prect, params); } } /* If we already have the band's data, just return it */ @@ -905,7 +905,7 @@ clist_get_bits_rect_mt(gx_device *dev, const gs_int_rect * prect, band_rect.p.y = 0; band_rect.q.y = lines_rasterized; code = dev_proc(bdev, get_bits_rectangle) - (bdev, &band_rect, params, unread); + (bdev, &band_rect, params); cdev->buf_procs.destroy_buf_device(bdev); if (code < 0) goto free_thread_out; @@ -924,7 +924,7 @@ clist_get_bits_rect_mt(gx_device *dev, const gs_int_rect * prect, * rectangles, punt. */ if (!(options & GB_RETURN_COPY) || code > 0) - return gx_default_get_bits_rectangle(dev, prect, params, unread); + return gx_default_get_bits_rectangle(dev, prect, params); options = params->options; if (!(options & GB_RETURN_COPY)) { /* Redo the first piece with copying. */ @@ -952,7 +952,7 @@ clist_get_bits_rect_mt(gx_device *dev, const gs_int_rect * prect, band_rect.p.y = my; band_rect.q.y = my + lines_rasterized; code = dev_proc(bdev, get_bits_rectangle) - (bdev, &band_rect, &band_params, unread); + (bdev, &band_rect, &band_params); if (code < 0) break; params->options = band_params.options; diff --git a/base/gxdevcli.h b/base/gxdevcli.h index 6b8b065d1..9364349c0 100644 --- a/base/gxdevcli.h +++ b/base/gxdevcli.h @@ -1077,7 +1077,7 @@ typedef enum FILTER_FLAGS { #define dev_t_proc_get_bits_rectangle(proc, dev_t)\ int proc(dev_t *dev, const gs_int_rect *prect,\ - gs_get_bits_params_t *params, gs_int_rect **unread) + gs_get_bits_params_t *params) #define dev_proc_get_bits_rectangle(proc)\ dev_t_proc_get_bits_rectangle(proc, gx_device) diff --git a/base/gxdownscale.c b/base/gxdownscale.c index 6ebf57905..4e36c81ae 100644 --- a/base/gxdownscale.c +++ b/base/gxdownscale.c @@ -2006,7 +2006,7 @@ getbits_chunky_line(gx_downscale_liner *liner_, void *buffer, int row) GB_RASTER_STANDARD | GB_PACKING_CHUNKY | GB_COLORS_NATIVE | GB_ALPHA_NONE); params.data[0] = buffer; - return (*dev_proc(liner->dev, get_bits_rectangle))(liner->dev, &rect, ¶ms, NULL); + return (*dev_proc(liner->dev, get_bits_rectangle))(liner->dev, &rect, ¶ms); } static void @@ -2044,7 +2044,7 @@ getbits_planar_line(gx_downscale_liner *liner_, void *output, int row) params2 = *params; - code = (*dev_proc(liner->dev, get_bits_rectangle))(liner->dev, &rect, ¶ms2, NULL); + code = (*dev_proc(liner->dev, get_bits_rectangle))(liner->dev, &rect, ¶ms2); /* get_bits_rectangle doesn't like doing planar copies, only return * pointers. This is a problem for us, so fudge it here. */ @@ -3216,7 +3216,7 @@ static int downscaler_process_fn(void *arg_, gx_device *dev, gx_device *bdev, co /* Where do we get the data from? */ params.options = GB_COLORS_NATIVE | GB_ALPHA_NONE | GB_PACKING_CHUNKY | GB_RETURN_POINTER | GB_ALIGN_ANY | GB_OFFSET_0 | GB_RASTER_ANY; - code = dev_proc(bdev, get_bits_rectangle)(bdev, &in_rect, ¶ms, NULL); + code = dev_proc(bdev, get_bits_rectangle)(bdev, &in_rect, ¶ms); if (code < 0) return code; raster_in = params.raster; @@ -3224,7 +3224,7 @@ static int downscaler_process_fn(void *arg_, gx_device *dev, gx_device *bdev, co /* Where do we write it to? */ if (buffer->bdev) { - code = dev_proc(bdev, get_bits_rectangle)(buffer->bdev, &out_rect, ¶ms, NULL); + code = dev_proc(bdev, get_bits_rectangle)(buffer->bdev, &out_rect, ¶ms); if (code < 0) return code; raster_out = params.raster; diff --git a/base/gxoprect.c b/base/gxoprect.c index 9b409e8c0..08f64eb7e 100644 --- a/base/gxoprect.c +++ b/base/gxoprect.c @@ -308,8 +308,7 @@ gx_overprint_generic_fill_rectangle( gb_rect.q.y = y; code = dev_proc(tdev, get_bits_rectangle)( tdev, &gb_rect, - &gb_params, - 0 ); + &gb_params ); if (code < 0) break; unpack_proc(pcolor_buff, gb_buff, 0, w, depth); @@ -496,8 +495,7 @@ gx_overprint_sep_fill_rectangle_1( gb_rect.q.y = y; code = dev_proc(tdev, get_bits_rectangle)( tdev, &gb_rect, - &gb_params, - 0 ); + &gb_params ); if (code < 0) break; bits_fill_rectangle_masked( gb_buff, @@ -586,8 +584,7 @@ gx_overprint_sep_fill_rectangle_2( gb_rect.q.y = y; code = dev_proc(tdev, get_bits_rectangle)( tdev, &gb_rect, - &gb_params, - 0 ); + &gb_params ); if (code < 0) break; for (i = 0, j = 0; i < byte_w; i++, cp++) { diff --git a/base/gxpcmap.c b/base/gxpcmap.c index 1e41b40c8..bdcca0c8e 100644 --- a/base/gxpcmap.c +++ b/base/gxpcmap.c @@ -666,7 +666,7 @@ blank_unmasked_bits(gx_device * mask, GB_COLORS_NATIVE | GB_ALPHA_NONE); params.data[0] = min; code = (*dev_proc(mask, get_bits_rectangle))(mask, &rect, - ¶ms, NULL); + ¶ms); if (code < 0) goto fail; mine = params.data[0]; @@ -720,7 +720,7 @@ blank_unmasked_bits(gx_device * mask, GB_COLORS_NATIVE | GB_ALPHA_NONE); params.data[0] = min; code = (*dev_proc(mask, get_bits_rectangle))(mask, &rect, - ¶ms, NULL); + ¶ms); if (code < 0) goto fail; mine = params.data[0]; @@ -755,7 +755,7 @@ fail: /****** SHOULD USE MASK TO DEFINE UNREAD AREA *****/ static int pattern_accum_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) + gs_get_bits_params_t * params) { gx_device_pattern_accum *const padev = (gx_device_pattern_accum *) dev; int code; @@ -765,7 +765,7 @@ pattern_accum_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, if (padev->mask) params2.options &= ~GB_RETURN_POINTER; code = (*dev_proc(padev->target, get_bits_rectangle)) - (padev->target, prect, ¶ms2, unread); + (padev->target, prect, ¶ms2); /* If we have a mask, then unmarked pixels of the bits * will be undefined. Strictly speaking it makes no * sense for us to return any value here, but the only diff --git a/devices/gdevcmykog.c b/devices/gdevcmykog.c index b2498fdfd..513a56f56 100644 --- a/devices/gdevcmykog.c +++ b/devices/gdevcmykog.c @@ -522,7 +522,7 @@ cmykog_process(void *arg_, gx_device *dev_, gx_device *bdev, const gs_int_rect * my_rect.p.y = 0; my_rect.q.x = w; my_rect.q.y = h; - code = dev_proc(bdev, get_bits_rectangle)(bdev, &my_rect, &buffer->params, NULL); + code = dev_proc(bdev, get_bits_rectangle)(bdev, &my_rect, &buffer->params); if (code < 0) return code; diff --git a/devices/gdevdsp.c b/devices/gdevdsp.c index fdb1dab56..d772ccfdc 100644 --- a/devices/gdevdsp.c +++ b/devices/gdevdsp.c @@ -361,7 +361,7 @@ display_output_page(gx_device * dev, int copies, int flush) params.original_y = oy; params.raster = raster; code = dev_proc(ddev, get_bits_rectangle)((gx_device *)ddev, - &rect, ¶ms, NULL); + &rect, ¶ms); if (code < 0) break; } @@ -814,13 +814,12 @@ display_copy_color(gx_device * dev, static int display_get_bits_rectangle(gx_device * dev, const gs_int_rect *rect, - gs_get_bits_params_t *params, - gs_int_rect ** unread) + gs_get_bits_params_t *params) { gx_device_display *ddev = (gx_device_display *) dev; if (ddev->callback == NULL) return gs_error_Fatal; - return ddev->mutated_procs.get_bits_rectangle(dev, rect, params, unread); + return ddev->mutated_procs.get_bits_rectangle(dev, rect, params); } static int diff --git a/devices/gdevfpng.c b/devices/gdevfpng.c index a885c2a5f..d57df8f8b 100644 --- a/devices/gdevfpng.c +++ b/devices/gdevfpng.c @@ -256,7 +256,7 @@ static int fpng_process(void *arg, gx_device *dev, gx_device *bdev, const gs_int my_rect.p.y = 0; my_rect.q.x = w; my_rect.q.y = h; - code = dev_proc(bdev, get_bits_rectangle)(bdev, &my_rect, ¶ms, NULL); + code = dev_proc(bdev, get_bits_rectangle)(bdev, &my_rect, ¶ms); if (code < 0) return code; diff --git a/devices/gdevplan.c b/devices/gdevplan.c index 48c5314f6..0ce82cda4 100644 --- a/devices/gdevplan.c +++ b/devices/gdevplan.c @@ -515,7 +515,7 @@ plan_print_page_loop(gx_device_printer * pdev, int log2bits, int numComps, else options |= GB_PACKING_PLANAR; for (lnum = 0; lnum < pdev->height; lnum++) { - gs_int_rect *unread, rect; + gs_int_rect rect; gs_get_bits_params_t params; rect.p.x = 0; @@ -525,7 +525,7 @@ plan_print_page_loop(gx_device_printer * pdev, int log2bits, int numComps, memset(¶ms, 0, sizeof(params)); params.options = options; params.x_offset = 0; - code = (*dev_proc(pdev, get_bits_rectangle))((gx_device *)pdev, &rect, ¶ms,&unread); + code = (*dev_proc(pdev, get_bits_rectangle))((gx_device *)pdev, &rect, ¶ms); if (code < 0) break; #ifdef DEBUG_DUMP diff --git a/devices/gdevplib.c b/devices/gdevplib.c index e4e02d1ab..e4288717e 100644 --- a/devices/gdevplib.c +++ b/devices/gdevplib.c @@ -601,7 +601,7 @@ plib_setup_buf_device(gx_device *bdev, byte *buffer, int bytes_per_line, static int plib_get_bits_rectangle_mem(gx_device *pdev, const gs_int_rect *prect, - gs_get_bits_params_t *params, gs_int_rect **pprect) + gs_get_bits_params_t *params) { gx_device_memory *mdev = (gx_device_memory *)pdev; int x = prect->p.x, y = prect->p.y, h = prect->q.y - y; @@ -623,7 +623,7 @@ plib_get_bits_rectangle_mem(gx_device *pdev, const gs_int_rect *prect, if (code >= 0) return code; } - return mem_get_bits_rectangle(pdev, prect, params, pprect); + return mem_get_bits_rectangle(pdev, prect, params); } static int @@ -871,7 +871,7 @@ plib_print_page_loop(gx_device_printer * pdev, int log2bits, int numComps, dump_start(pdev->width, pdev->height, numComps, log2bits, pstream); #endif for (lnum = 0; lnum < pdev->height; lnum += bandHeight) { - gs_int_rect *unread, rect; + gs_int_rect rect; gs_get_bits_params_t params; rect.p.x = 0; @@ -889,7 +889,7 @@ plib_print_page_loop(gx_device_printer * pdev, int log2bits, int numComps, GB_COLORS_NATIVE | GB_ALPHA_NONE; params.x_offset = 0; - code = (*dev_proc(pdev, get_bits_rectangle))((gx_device *)pdev, &rect, ¶ms,&unread); + code = (*dev_proc(pdev, get_bits_rectangle))((gx_device *)pdev, &rect, ¶ms); if (code < 0) break; #ifdef DEBUG_DUMP diff --git a/devices/gdevpng.c b/devices/gdevpng.c index 2558a2ad7..b41397eb2 100644 --- a/devices/gdevpng.c +++ b/devices/gdevpng.c @@ -1023,7 +1023,7 @@ pngalpha_copy_alpha(gx_device * dev, const byte * data, int data_x, GB_RASTER_STANDARD | GB_PACKING_CHUNKY | GB_COLORS_NATIVE | GB_ALPHA_NONE); params.data[0] = lin; - code = (*dev_proc(dev, get_bits_rectangle))(dev, &rect, ¶ms, NULL); + code = (*dev_proc(dev, get_bits_rectangle))(dev, &rect, ¶ms); if (code < 0) break; line = params.data[0]; diff --git a/devices/gdevtsep.c b/devices/gdevtsep.c index be5a9518d..402d24f0a 100644 --- a/devices/gdevtsep.c +++ b/devices/gdevtsep.c @@ -2796,7 +2796,7 @@ tiffsep1_print_page(gx_device_printer * pdev, gp_file * file) /* We have to reset the pointers since get_bits_rect will have moved them */ for (comp_num = 0; comp_num < num_comp; comp_num++) params.data[comp_num] = planes[comp_num]; - code = (*dev_proc(pdev, get_bits_rectangle))((gx_device *)pdev, &rect, ¶ms, NULL); + code = (*dev_proc(pdev, get_bits_rectangle))((gx_device *)pdev, &rect, ¶ms); if (code < 0) break; diff --git a/devices/gdevupd.c b/devices/gdevupd.c index 32e82bdcd..663598476 100644 --- a/devices/gdevupd.c +++ b/devices/gdevupd.c @@ -1124,7 +1124,7 @@ upd_print_page(gx_device_printer *pdev, gp_file *out) GB_COLORS_NATIVE | GB_ALPHA_NONE); params.data[0] = upd->gsbuf; if(0 > (*dev_proc(udev,get_bits_rectangle))((gx_device *) udev, - &rect,¶ms,NULL)) { + &rect,¶ms)) { #if UPD_MESSAGES & UPD_M_WARNING errprintf(udev->memory, "get_bits aborted with error, yscnbuf = %4d\n", upd->yscnbuf); diff --git a/devices/gdevx.c b/devices/gdevx.c index 0ea2dabf0..ee5aedcb8 100644 --- a/devices/gdevx.c +++ b/devices/gdevx.c @@ -664,7 +664,7 @@ x_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles, /* Read bits back from the screen. */ int x_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, gs_int_rect ** unread) + gs_get_bits_params_t * params) { gx_device_X *xdev = (gx_device_X *) dev; int depth = dev->color_info.depth; @@ -696,7 +696,7 @@ x_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, !(options & GB_RASTER_ALL) ) return - gx_default_get_bits_rectangle(dev, prect, params, unread); + gx_default_get_bits_rectangle(dev, prect, params); params->options = GB_COLORS_NATIVE | GB_ALPHA_NONE | GB_PACKING_CHUNKY | GB_RETURN_COPY | GB_OFFSET_0 | @@ -716,22 +716,6 @@ x_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, } else update_do_flush(xdev); /* - * If we want a list of unread rectangles, turn on graphics - * exposures, and accept exposure events. - */ - /****** - ****** FOLLOWING IS WRONG. XGetImage DOES NOT GENERATE - ****** EXPOSURE EVENTS. - ******/ -#if GET_IMAGE_EXPOSURES - if (unread) { - XSetGraphicsExposures(xdev->dpy, xdev->gc, True); - XGetWindowAttributes(xdev->dpy, xdev->win, &attributes); - XSelectInput(xdev->dpy, xdev->win, - attributes.your_event_mask | ExposureMask); - } -#endif /* GET_IMAGE_EXPOSURES */ - /* * The X library doesn't provide any way to specify the desired * bit or byte ordering for the result, so we may have to swap the * bit or byte order. @@ -809,49 +793,6 @@ x_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect, } XDestroyImage(image); } - if (unread) { -#if GET_IMAGE_EXPOSURES - XEvent event; -#endif /* GET_IMAGE_EXPOSURES */ - - *unread = 0; -#if GET_IMAGE_EXPOSURES - /* Read any exposure events. */ - XWindowEvent(xdev->dpy, xdev->win, ExposureMask, &event); - if (event.type == GraphicsExpose) { - gs_int_rect *rects = (gs_int_rect *) - gs_alloc_bytes(dev->memory, sizeof(gs_int_rect), - "x_get_bits_rectangle"); - int num_rects = 0; - - for (;;) { - if (rects == 0) { - code = gs_note_error(gs_error_VMerror); - break; - } -#define xevent (*(XGraphicsExposeEvent *)&event) - rects[num_rects].q.x = xevent.width + - (rects[num_rects].p.x = xevent.x); - rects[num_rects].q.y = xevent.height + - (rects[num_rects].p.y = xevent.y); - ++num_rects; - if (!xevent.count) - break; -#undef xevent - rects = gs_resize_object(dev->memory, rects, - (num_rects + 1) * sizeof(gs_int_rect), - "x_get_bits_rectangle"); - } - if (code >= 0) { - *unread = rects; - code = num_rects; - } - } - /* Restore the window state. */ - XSetGraphicsExposures(xdev->dpy, xdev->gc, False); - XSelectInput(xdev->dpy, xdev->win, attributes.your_event_mask); -#endif /* GET_IMAGE_EXPOSURES */ - } return code; } diff --git a/devices/gdevxalt.c b/devices/gdevxalt.c index 816d04cf6..34157d4a3 100644 --- a/devices/gdevxalt.c +++ b/devices/gdevxalt.c @@ -299,19 +299,19 @@ x_forward_copy_color(gx_device * dev, const byte * base, int sourcex, static int x_forward_get_bits_rectangle(gx_device * dev, const gs_int_rect *prect, - gs_get_bits_params_t *params, gs_int_rect **unused) + gs_get_bits_params_t *params) { gx_device *tdev; int code; if ((code = get_dev_target(&tdev, dev)) < 0) return code; - return (*dev_proc(tdev, get_bits_rectangle)) (tdev, prect, params, unused); + return (*dev_proc(tdev, get_bits_rectangle)) (tdev, prect, params); } static int x_wrap_get_bits_rectangle(gx_device * dev, const gs_int_rect *prect, - gs_get_bits_params_t *params, gs_int_rect **unused) + gs_get_bits_params_t *params) { int depth = dev->color_info.depth; gx_device *tdev; @@ -371,7 +371,7 @@ x_wrap_get_bits_rectangle(gx_device * dev, const gs_int_rect *prect, lparams.raster = 0; lparams.data[0] = row; lparams.x_offset = 0; - code = (*dev_proc(tdev, get_bits_rectangle))(tdev, &rect, &lparams, NULL); + code = (*dev_proc(tdev, get_bits_rectangle))(tdev, &rect, &lparams); if (code < 0) break; base = lparams.data[0]; diff --git a/devices/vector/gdevpsdu.c b/devices/vector/gdevpsdu.c index 41558a712..210e224a7 100644 --- a/devices/vector/gdevpsdu.c +++ b/devices/vector/gdevpsdu.c @@ -475,8 +475,7 @@ int psdf_get_bits_rectangle( gx_device * dev, const gs_int_rect * prect, - gs_get_bits_params_t * params, - gs_int_rect ** unread ) + gs_get_bits_params_t * params ) { emprintf(dev->memory, "Can't set GraphicsAlphaBits or TextAlphaBits with a vector device.\n"); diff --git a/doc/Drivers.htm b/doc/Drivers.htm index d0d1d38a4..4e9fb37a8 100644 --- a/doc/Drivers.htm +++ b/doc/Drivers.htm @@ -2851,8 +2851,7 @@ if the glyph can't be translated to Unicode.</p> <dl> <dt><code>int (*get_bits_rectangle)(gx_device *dev, -const gs_int_rect *prect, gs_get_bits_params_t *params, -gs_int_rect **unread)</code> <b><em>[OPTIONAL]</em></b></dt> +const gs_int_rect *prect, gs_get_bits_params_t *params)</code> <b><em>[OPTIONAL]</em></b></dt> <p><dd> Read a rectangle of bits back from the device. The <code>params</code> @@ -2967,24 +2966,6 @@ in each scan line are undefined. If the implementation returns pointers to the data, it stores them into <code>data[0]</code> or <code>data[</code><b><em>0..N-1</em></b><code>]</code>.</p> -<p> -If not all the source data are available (for example, because the source -was a partially obscured window and backing store was not available or not -used), or if the rectangle does not fall completely within the device's -coordinate system, any unread bits are undefined, and the value returned -depends on whether unread is <code>NULL</code>. If unread is -<code>NULL</code>, return <code>gs_error_ioerror</code>; in this case, -some bits may or may not have been read. If unread is not -<code>NULL</code>, allocate (using <code>dev</code>->memory) and -fill in a list of rectangles that could not be read, store the pointer to -the list in <code>*unread</code>, and return the number of rectangles; in -this case, all bits not listed in the rectangle list have been read back -properly. The list is not sorted in any particular order, but the -rectangles do not overlap. Note that the rectangle list may cover a -superset of the region actually obscured: for example, a lazy implementation -could return a single rectangle that was the bounding box of the region.</p> -</dl> - <h3><a name="Parameters"></a>Parameters</h3> <p> diff --git a/psi/zdevice.c b/psi/zdevice.c index 3ba01fc35..b119a7687 100644 --- a/psi/zdevice.c +++ b/psi/zdevice.c @@ -222,7 +222,7 @@ zgetbitsrect(i_ctx_t *i_ctx_p) rect.q.y = rect.p.y + h; params.options = options; params.data[0] = op->value.bytes; - code = (*dev_proc(dev, get_bits_rectangle))(dev, &rect, ¶ms, NULL); + code = (*dev_proc(dev, get_bits_rectangle))(dev, &rect, ¶ms); if (code < 0) return code; make_int(op - 7, h); |