summaryrefslogtreecommitdiff
path: root/pcl
diff options
context:
space:
mode:
Diffstat (limited to 'pcl')
-rw-r--r--pcl/pcl/pctop.c15
-rw-r--r--pcl/pxl/pxtop.c18
2 files changed, 17 insertions, 16 deletions
diff --git a/pcl/pcl/pctop.c b/pcl/pcl/pctop.c
index ad4ebf4cc..224614d5d 100644
--- a/pcl/pcl/pctop.c
+++ b/pcl/pcl/pctop.c
@@ -346,6 +346,14 @@ pcl_impl_init_job(pl_interp_implementation_t * impl, /* interp instance to
if ((code = gs_setdevice_no_erase(pcli->pcs.pgs, device)) < 0) /* can't erase yet */
goto pisdEnd;
+ /* Warn the device we use ROPs. Do this early, as it may cause the
+ * device to change color model. */
+ code = put_param1_bool(&pcli->pcs, "LanguageUsesROPs", true);
+ if (!device->is_open)
+ code = gs_opendevice(device);
+ if (code < 0)
+ return code;
+
stage = Sinitg;
/* Do inits of gstate that may be reset by setdevice */
/* PCL no longer uses the graphic library transparency mechanism */
@@ -417,13 +425,6 @@ pcl_impl_init_job(pl_interp_implementation_t * impl, /* interp instance to
break;
}
- /* Warn the device we use ROPs */
- if (code == 0) {
- code = put_param1_bool(&pcli->pcs, "LanguageUsesROPs", true);
- if (!device->is_open)
- code = gs_opendevice(device);
- }
-
return code;
}
diff --git a/pcl/pxl/pxtop.c b/pcl/pxl/pxtop.c
index 93435ceef..b9a6291f3 100644
--- a/pcl/pxl/pxtop.c
+++ b/pcl/pxl/pxtop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -277,6 +277,14 @@ pxl_impl_init_job(pl_interp_implementation_t * impl,
if ((code = gs_setdevice_no_erase(pxli->pgs, device)) < 0) /* can't erase yet */
goto pisdEnd;
+ /* Warn the device that PXL uses ROPs. */
+ if (code == 0) {
+ code = put_param_bool(pxli, "LanguageUsesROPs", true);
+
+ if (!device->is_open)
+ code = gs_opendevice(device);
+ }
+
/* Init XL graphics */
stage = Sinitg;
if ((code = px_initgraphics(pxli->pxs)) < 0)
@@ -322,14 +330,6 @@ pxl_impl_init_job(pl_interp_implementation_t * impl,
break;
}
- /* Warn the device that PXL uses ROPs. */
- if (code == 0) {
- code = put_param_bool(pxli, "LanguageUsesROPs", true);
-
- if (!device->is_open)
- code = gs_opendevice(device);
- }
-
return code;
}