summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'base/gxclrast.c')
-rw-r--r--base/gxclrast.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/base/gxclrast.c b/base/gxclrast.c
index 60c0ef77..f9f42d88 100644
--- a/base/gxclrast.c
+++ b/base/gxclrast.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2020 Artifex Software, Inc.
+/* Copyright (C) 2001-2021 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -475,7 +475,8 @@ read_set_misc_map(byte cb, command_buf_t *pcb, gs_gstate *pgs, gs_memory_t *mem)
int
clist_playback_band(clist_playback_action playback_action,
gx_device_clist_reader *cdev, stream *s,
- gx_device *target, int x0, int y0, gs_memory_t * mem)
+ gx_device *target, int x0, int y0,
+ gs_memory_t * mem) /* lgtm [cpp/use-of-goto] */
{
byte *cbuf_storage;
command_buf_t cbuf;
@@ -3095,18 +3096,11 @@ static int apply_create_compositor(gx_device_clist_reader *cdev, gs_gstate *pgs,
* change the target device.
*/
code = dev_proc(tdev, create_compositor)(tdev, &tdev, pcomp, pgs, mem, (gx_device*) cdev);
- if (code >= 0 && tdev != *ptarget) {
- /* If we created a new compositor here, then that new compositor should
- * become the device to which we send all future drawing requests. If
- * the above create_compositor call found an existing compositor
- * already in the chain of devices (such as might happen when we are
- * playing back a clist based pattern, and the top device is a clip
- * device that forwards to a pdf14 device), then we'll just reuse
- * that one. We do not want to send new drawing operations to the
- * compositor, as that will sidestep the clipping. We therefore check
- * the reference count to see if this is a new device or not. */
- if (tdev->rc.ref_count == 1)
- *ptarget = tdev;
+ if (code == 1) {
+ /* A new compositor was created that wrapped tdev. This should
+ * be our new target. */
+ *ptarget = tdev;
+ code = 0;
}
if (code < 0)
return code;