summaryrefslogtreecommitdiff
path: root/base/gxdevice.h
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2018-09-30 22:57:33 +0100
committerKen Sharp <ken.sharp@artifex.com>2018-10-02 12:28:12 +0100
commitcbdc54055b7db024951daf3dcb3cafe0af458e47 (patch)
treeca35d56a3537cbf846d4664a0dc54b9f2f3a58a6 /base/gxdevice.h
parent9565f4ca4aab712f411420fa4c8cae79a2cf88ed (diff)
downloadghostpdl-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/gxdevice.h')
-rw-r--r--base/gxdevice.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/base/gxdevice.h b/base/gxdevice.h
index 4b6c5198c..abf0c534f 100644
--- a/base/gxdevice.h
+++ b/base/gxdevice.h
@@ -408,6 +408,7 @@ dev_proc_fill_linear_color_triangle(gx_forward_fill_linear_color_triangle);
dev_proc_update_spot_equivalent_colors(gx_forward_update_spot_equivalent_colors);
dev_proc_ret_devn_params(gx_forward_ret_devn_params);
dev_proc_fillpage(gx_forward_fillpage);
+dev_proc_put_image(gx_forward_put_image);
dev_proc_copy_planes(gx_forward_copy_planes);
dev_proc_create_compositor(gx_forward_create_compositor);
dev_proc_get_profile(gx_forward_get_profile);