summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2019-08-21 14:28:20 +0100
committerRobin Watts <Robin.Watts@artifex.com>2019-08-21 17:58:18 +0100
commitece0c97f7c85af0dbd31532da4a7bef2c1f6fd0c (patch)
tree889d4e12a62bedacb208220c956c8c07017aa44d
parent75da8d9a2054f5a08817c42adbb2fa967cc9dad7 (diff)
downloadghostpdl-ece0c97f7c85af0dbd31532da4a7bef2c1f6fd0c.tar.gz
Bug 701451: Fix clist color_usage calculations for shadings.
Or rather, don't attempt to calculate them badly, and just use the safe "all colors" value.
-rw-r--r--base/gxclrect.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/base/gxclrect.c b/base/gxclrect.c
index 07f398f21..a4b5982d1 100644
--- a/base/gxclrect.c
+++ b/base/gxclrect.c
@@ -425,21 +425,6 @@ clist_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
return 0;
}
-static void update_color_use_frac_array(uchar num_colors, const frac31 *color,
- cmd_rects_enum_t *re)
-{
- uchar k;
-
- if (color == NULL)
- return;
-
- for (k = 0; k < num_colors; k++){
- if (color[k] != 0) {
- re->pcls->color_usage.or |= (1<<k);
- }
- }
-}
-
static inline int
clist_write_fill_trapezoid(gx_device * dev,
const gs_fixed_edge *left, const gs_fixed_edge *right,
@@ -517,14 +502,11 @@ clist_write_fill_trapezoid(gx_device * dev,
} else {
/* Even with pdcolor NULL, we may still have colors packed in
c0, c1, c2 or c3 */
- update_color_use_frac_array(dev->color_info.num_components, c0, &re);
- update_color_use_frac_array(dev->color_info.num_components, c1, &re);
- update_color_use_frac_array(dev->color_info.num_components, c2, &re);
- update_color_use_frac_array(dev->color_info.num_components, c3, &re);
+ re.pcls->color_usage.or |= gx_color_usage_all(cdev);
code = 0;
}
if (code >= 0) {
- /* Dont't want to shorten the trapezoid by the band boundary,
+ /* Don't want to shorten the trapezoid by the band boundary,
keeping in mind a further optimization with writing same data to all bands. */
code = cmd_write_trapezoid_cmd(cdev, re.pcls, cmd_opv_fill_trapezoid, left, right,
ybot, ytop, options, fa, c0, c1, c2, c3);