diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2018-09-30 22:57:33 +0100 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2018-10-02 12:28:12 +0100 |
commit | cbdc54055b7db024951daf3dcb3cafe0af458e47 (patch) | |
tree | ca35d56a3537cbf846d4664a0dc54b9f2f3a58a6 /base/gdevoflt.c | |
parent | 9565f4ca4aab712f411420fa4c8cae79a2cf88ed (diff) | |
download | ghostpdl-cbdc54055b7db024951daf3dcb3cafe0af458e47.tar.gz |
Change device put_image method to match the other methods in the API
The put_image device method was unique in that the device parameter
passed to the method was not a pointer to a device structure of the
device implementing the method, but was a pointer to a device
structure describing a memory device.
This allowed the memory device to use code from the underlying device,
which knows how its page buffer is laid out, but data from the memory
device which rendered the composited transparent operations.
However, this doesn't work at all if we have a chain of devices because
the device method which we pull from the device at the head of the
chain, is not the method used to actually rendeer to the page buffer
of the terminating deevice in the chain.
This commit alters the prorotype to take two device pointers, one for
the 'terget' device, and one for the memory device which executed the
put_image. This allows the final device in the chain to use its own
code to format the buffer pointers from the memory device, while
allowing intermediate devices to simply pass on the call.
Note that previously a few places checked the put_image method against
gx_default_put_image (before the device API rationalisation this was a
check against NULL) and only called put_image if it was not the default.
Now that we have a default implementation (which returns an error), and
knowing that the existing device methods return an error if they do not
implment some aspect of the memory layout, we can avoid the test
altogether; simply call the put_image, the code is already prepared
to deal with an error return whether that be because the device does not
implement the method or becuase the device cannot cope with some aspect
of the layout.
Diffstat (limited to 'base/gdevoflt.c')
-rw-r--r-- | base/gdevoflt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/base/gdevoflt.c b/base/gdevoflt.c index 966012d48..cb50465d4 100644 --- a/base/gdevoflt.c +++ b/base/gdevoflt.c @@ -530,12 +530,12 @@ int obj_filter_fill_linear_color_triangle(gx_device *dev, const gs_fill_attribut return 0; } -int obj_filter_put_image(gx_device *dev, const byte **buffers, int num_chan, int x, int y, +int obj_filter_put_image(gx_device *dev, gx_device *mdev, const byte **buffers, int num_chan, int x, int y, int width, int height, int row_stride, int alpha_plane_index, int tag_plane_index) { if ((dev->ObjectFilter & FILTERIMAGE) == 0) - return default_subclass_put_image(dev, buffers, num_chan, x, y, width, height, row_stride, alpha_plane_index, tag_plane_index); + return default_subclass_put_image(dev, mdev, buffers, num_chan, x, y, width, height, row_stride, alpha_plane_index, tag_plane_index); return 0; } |