From 21bfa635fb1e9fc0adce4b0455e367e56c0e33c2 Mon Sep 17 00:00:00 2001 From: Chris Liddell Date: Wed, 7 Mar 2012 17:13:35 +0000 Subject: Problems with glyphs, T1 patterns and transparecy..... From investigations of a problem reported by customer 532. When imaging a cached glyph, if the glyph bitmap cannot be inserted into the clist tile cache, we'd normally resort to degenerating the glyph bitmap into rectangles, and writing those to the clist. When the glyph is filled with a tiling (Type 1) pattern, this means going through the pattern tiling code. The problem is when transparency is involved (i.e. if the pattern is in a trans group, or contains a transparency group) the tiling code cannot reliably degerate to rectangles at this stage. This usually just works due to the various fallbacks in the clist writing code and the glyph imaging code, but occasionally glyphs can either disappear, or other problems occur. This change makes us use that "fallback" route for all glyphs when we're filling a glyph with a type 1 pattern, with transprency involved and we're writing to a clist device. NOTE: this is analogous to what the FAPI does in similar circumstances for uncached glyphs. No cluster differences. --- gs/base/gsptype1.c | 10 ++++++++++ gs/base/gsptype1.h | 3 +++ gs/base/gxccache.c | 5 +++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gs/base/gsptype1.c b/gs/base/gsptype1.c index 9e497142f..1249a1084 100644 --- a/gs/base/gsptype1.c +++ b/gs/base/gsptype1.c @@ -1974,3 +1974,13 @@ gx_dc_is_pattern1_color(const gx_device_color *pdevc) { return (pdevc->type == &gx_dc_pattern || pdevc->type == &gx_dc_pattern_trans); } + +/* Check device color for Pattern Type 1 with transparency involved */ +bool +gx_dc_is_pattern1_color_with_trans(const gx_device_color *pdevc) +{ + if (!(pdevc->type == &gx_dc_pattern || pdevc->type == &gx_dc_pattern_trans)) { + return(false); + } + return(gx_pattern1_get_transptr(pdevc) != NULL); +} diff --git a/gs/base/gsptype1.h b/gs/base/gsptype1.h index 32cf7bd24..b81404b58 100644 --- a/gs/base/gsptype1.h +++ b/gs/base/gsptype1.h @@ -91,6 +91,9 @@ const gs_client_pattern *gs_getpattern(const gs_client_color *); /* Check device color for Pattern Type 1. */ bool gx_dc_is_pattern1_color(const gx_device_color *pdevc); +/* Check device color for Pattern Type 1 with transparency involved */ +bool gx_dc_is_pattern1_color_with_trans(const gx_device_color *pdevc); + /* Get transparency pointer */ void * gx_pattern1_get_transptr(const gx_device_color *pdevc); /* pattern is clist with transparency */ diff --git a/gs/base/gxccache.c b/gs/base/gxccache.c index 30fb41825..2cbc77530 100644 --- a/gs/base/gxccache.c +++ b/gs/base/gxccache.c @@ -295,8 +295,9 @@ gx_image_cached_char(register gs_show_enum * penum, register cached_char * cc) * We need to map 4 bitmap bits to 2 alpha bits. */ depth = (cc_depth(cc) == 3 ? 2 : cc_depth(cc)); - if (dev_proc(orig_dev, fill_mask) != gx_default_fill_mask || - !lop_no_S_is_T(pgs->log_op) + if ((dev_proc(orig_dev, fill_mask) != gx_default_fill_mask || + !lop_no_S_is_T(pgs->log_op) && + !gx_dc_is_pattern1_color_with_trans(pdevc)) ) { gx_clip_path *pcpath; -- cgit v1.2.1