diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2021-02-22 19:57:35 +0000 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2021-02-24 19:45:46 +0000 |
commit | a754bd375a625368567947b1e1b77ce3e5c06a3f (patch) | |
tree | 87d6212fcbc5b1ef6e56c12f7d01c8063e544b3b /base/gdevbbox.c | |
parent | 34e7384e42da98e781efd4f68ef0e510dc7ffd40 (diff) | |
download | ghostpdl-a754bd375a625368567947b1e1b77ce3e5c06a3f.tar.gz |
Bug 703265: Tweak create_compositor device method.
Update create_compositor device method, so that it always returns
the compositor device (or the leaf device if there is no specific
compositor device). The device now returns 1 if we created a
compositor device to wrap the given device.
This should enable us to identify exactly the cases where forwarding
devices need to update which device they forward to.
In particular, this allows us to remove the horribly fragile code
in apply_create_compositor in gxclrast.c, and to ensure that we
correctly identify the 'new compositor' case.
This avoids us sending stuff to the wrong device, and having to
cope with a slew of warnings.
Diffstat (limited to 'base/gdevbbox.c')
-rw-r--r-- | base/gdevbbox.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/base/gdevbbox.c b/base/gdevbbox.c index 33a421dbc..442b3ab00 100644 --- a/base/gdevbbox.c +++ b/base/gdevbbox.c @@ -1245,7 +1245,7 @@ bbox_create_compositor(gx_device * dev, (target, &temp_cdev, pcte, pgs, memory, cindev); /* If the target did not create a new compositor then we are done. */ - if (code < 0 || target == temp_cdev) { + if (code <= 0) { *pcdev = dev; return code; } @@ -1261,7 +1261,9 @@ bbox_create_compositor(gx_device * dev, bbcdev->box_procs = box_procs_forward; bbcdev->box_proc_data = bdev; *pcdev = (gx_device *) bbcdev; - return 0; + /* We return 1 to indicate that a new compositor was created + * that wrapped dev. */ + return 1; } } |