[gs-commits] ghostpdl branch, gs9.28-temp-for-testing, updated. gs9.28-temp-for-testing-tag-18-g0288b86
[email protected] (Robin Watts)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, gs9.28-temp-for-testing has been updated
via 0288b86e20cdbf31b2df8030de242ffbe93fd418 (commit)
from 92bc858b03f206a0e08ca956cb3e5d2a825dffe8 (commit)
----------------------------------------------------------------------
commit 0288b86e20cdbf31b2df8030de242ffbe93fd418
Author: Robin Watts <[email protected]>
Date: Mon Sep 2 17:16:45 2019 +0100
Proper fix for deep color overprint.
The previous fix confused memset and memcpy. Properly write the
(native endian) 16 bit color values into the big endian buffer.
diff --git a/base/gsovrc.c b/base/gsovrc.c
index ad75b58..d29808d 100644
--- a/base/gsovrc.c
+++ b/base/gsovrc.c
@@ -1055,6 +1055,16 @@ overprint_copy_planes(gx_device * dev, const byte * data, int data_x, int raster
x, y, w, h, plane_height);
}
}
+static void
+my_memset16_be(uint16_t *dst, uint16_t col, size_t w)
+{
+#if !ARCH_IS_BIG_ENDIAN
+ col = (col>>8) | (col<<8);
+#endif
+ while (w--) {
+ *dst++ = col;
+ }
+}
/* Currently we really should only be here if the target device is planar
AND it supports devn colors AND is 8 or 16 bit. */
@@ -1143,8 +1153,12 @@ overprint_fill_rectangle_hl_color(gx_device *dev,
operation we would just get the ones needed and set those. */
if ((comps & 0x01) == 1) {
/* Not sure if a loop or a memset is better here */
- memset(gb_params.data[k],
- ((pdcolor->colors.devn.values[k]) >> shift & mask), w<<deep);
+ if (deep)
+ my_memset16_be((uint16_t *)(gb_params.data[k]),
+ pdcolor->colors.devn.values[k], w);
+ else
+ memset(gb_params.data[k],
+ ((pdcolor->colors.devn.values[k]) >> shift & mask), w);
}
comps >>= 1;
}
Summary of changes:
base/gsovrc.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)