summaryrefslogtreecommitdiff
path: root/base/gxiscale.c
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2017-11-12 11:10:49 +0000
committerKen Sharp <ken.sharp@artifex.com>2017-11-16 08:26:44 +0000
commitc9951359bde5c4e72a20624788a47a97872db090 (patch)
treec58867c8ef23131924fef7f1210a6c9608072ff4 /base/gxiscale.c
parente2565e030eb37a25459671cfa9119715f3a0aae4 (diff)
downloadghostpdl-c9951359bde5c4e72a20624788a47a97872db090.tar.gz
Repair the device API - device methods should never be NULL
The original intention of the device API was that device methods (with the odd exception of fill_rectangle) must not be NULL. That appears to have been broken with the introduction of the transparency compositor, with the result that the code now: 1) has to check for methods being NULL sometimes, because that causes crashes. 2) Uses a device method being NULL to determine code paths. We want to return the device method design, because having to check for NULL methods before calling is wasteful. In this commit: define default methods for all the methods that previously did not have one. Modify gx_device_fill_in_procs to include those defaults in the device methods which it checks for NULL and replaces. Finding all the places where the code path differs if a device method is NULL, alter to check against the default method instead. Remove NULL checks where they are no longer required. Device whose 'procs' get copied directly (clist) must have defaults for all methods. Fix gx_copy_device_procs so that we only special case (don't replace the method) for those few methods where it matters that the subclassing device must have the default method if the subclassed device does. Long term we should change the code not to rely on this! Remove a couple of macros that were not required or plain dumb.
Diffstat (limited to 'base/gxiscale.c')
-rw-r--r--base/gxiscale.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/gxiscale.c b/base/gxiscale.c
index 76b47fd2d..286db0041 100644
--- a/base/gxiscale.c
+++ b/base/gxiscale.c
@@ -152,7 +152,7 @@ static int mask_suitable_for_interpolation(gx_image_enum *penum)
dev_proc(penum->dev, copy_alpha) != gx_no_copy_alpha) {
/* We have a 'pure' color, and a valid copy_alpha. We can work with that. */
high_level_color = 0;
- } else if (dev_proc(penum->dev, copy_alpha_hl_color) == NULL) {
+ } else if (dev_proc(penum->dev, copy_alpha_hl_color) == gx_default_no_copy_alpha_hl_color) {
/* No copy_alpha_hl_color. We're out of luck. */
return -1;
} else if ((code = gx_color_load(pdc1, penum->pgs, penum->dev)) < 0) {