diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2018-08-18 10:44:52 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2018-08-18 10:44:52 +0100 |
commit | 6b1106c232bb18366c527f9da54715ac79165317 (patch) | |
tree | bb342cb0be6d878958f2ef6349a2d51715098b32 | |
parent | c265ee6563a1a65d225c4255d95d7306a21c3146 (diff) | |
download | ghostpdl-6b1106c232bb18366c527f9da54715ac79165317.tar.gz |
Fix display device (some more) with subclassing
Because the display device isn't based off one of the standard devices
we need to do extra work with it to ensure it behaves well with the
subclassing device code.
Commit 1203adc8bbcb60f0e4145300aac44f1988b7c2de contained some of this
work, but unfortunately it had an oversight, it didn't update the
parent (subclassing) devices when the device parameters changed.
This led to it using the wrong width for the raster, if the media
size changed after initialisation.
-rw-r--r-- | devices/gdevdsp.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/devices/gdevdsp.c b/devices/gdevdsp.c index bbf99de77..f88ee8ddf 100644 --- a/devices/gdevdsp.c +++ b/devices/gdevdsp.c @@ -1037,12 +1037,14 @@ display_put_params(gx_device * dev, gs_param_list * plist) * change the color format or handle. */ - while(dev->parent) + while(dev->parent) { dev = dev->parent; + gx_update_from_subclass(dev); + } /* Tell caller we are about to change the device parameters */ if ((*ddev->callback->display_presize)(ddev->pHandle, dev, - dev->width, dev->height, display_raster(ddev), + ddev->width, ddev->height, display_raster(ddev), ddev->nFormat) < 0) { /* caller won't let us change the size */ /* restore parameters then return an error */ @@ -1051,11 +1053,17 @@ display_put_params(gx_device * dev, gs_param_list * plist) display_set_color_format(ddev, old_format); ddev->nFormat = old_format; ddev->pHandle = old_handle; - dev->width = old_width; - dev->height = old_height; + ddev->width = old_width; + ddev->height = old_height; return_error(gs_error_rangecheck); } + dev = ddev; + while(dev->parent) { + dev = dev->parent; + gx_update_from_subclass(dev); + } + display_free_bitmap(ddev); code = display_alloc_bitmap(ddev, dev); |