[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1905-gc5eb242

[email protected] (Michael Vrhel) Wed, 20 Nov 2019 01:19:32 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  c5eb242fa82585aa21371919ca4a7a2d4d4effc3 (commit)
      from  69bdf79e10370ed16a17a346690fd630272f7346 (commit)

----------------------------------------------------------------------
commit c5eb242fa82585aa21371919ca4a7a2d4d4effc3
Author: Michael Vrhel <[email protected]>
Date:   Tue Nov 19 16:35:50 2019 -0800

    Make sure blend mode is passed to tile with pdfi

diff --git a/base/gxpcmap.c b/base/gxpcmap.c
index ea81fb0..3be145a 100644
--- a/base/gxpcmap.c
+++ b/base/gxpcmap.c
@@ -1025,7 +1025,7 @@ gx_pattern_cache_update_used(gs_gstate *pgs, ulong used)
 static void make_bitmap(gx_strip_bitmap *, const gx_device_memory *, gx_bitmap_id, const gs_memory_t *);
 int
 gx_pattern_cache_add_entry(gs_gstate * pgs,
-                   gx_device_forward * fdev, gx_color_tile ** pctile)
+                   gx_device_forward * fdev, gx_color_tile ** pctile, gs_gstate* saved)
 {
     gx_pattern_cache *pcache;
     const gs_pattern1_instance_t *pinst;
@@ -1133,8 +1133,10 @@ gx_pattern_cache_add_entry(gs_gstate * pgs,
     ctile->is_simple = pinst->is_simple;
     ctile->has_overlap = pinst->has_overlap;
     ctile->is_dummy = false;
-    if (pinst->templat.uses_transparency)
-        ctile->blending_mode = ((pdf14_device *)(pgs->device))->blend_mode;
+    if (pinst->templat.uses_transparency) {
+        /* to work with pdfi get the blend mode out of the saved pgs device */
+        ctile->blending_mode = ((pdf14_device*)(saved->device))->blend_mode;
+    }
     else
         ctile->blending_mode = 0;
     if (dev_proc(fdev, open_device) != pattern_clist_open_device) {
@@ -1537,7 +1539,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_gstate * pgs,
     }
     /* We REALLY don't like the following cast.... */
     code = gx_pattern_cache_add_entry((gs_gstate *)pgs,
-                adev, &ctile);
+                adev, &ctile, saved);
     if (code >= 0) {
         if (!gx_pattern_cache_lookup(pdc, pgs, dev, select)) {
             mlprintf(mem, "Pattern cache lookup failed after insertion!\n");
diff --git a/base/gxpcolor.h b/base/gxpcolor.h
index c12fa31..afa62b3 100644
--- a/base/gxpcolor.h
+++ b/base/gxpcolor.h
@@ -306,7 +306,7 @@ void gx_pattern_cache_update_space(gs_gstate * pgs, int64_t used);
 /* device, but it may zero out the bitmap_memory pointers to prevent */
 /* the accumulated bitmaps from being freed when the device is closed. */
 int gx_pattern_cache_add_entry(gs_gstate *, gx_device_forward *,
-                               gx_color_tile **);
+                               gx_color_tile **, gs_gstate*);
 /* Add a dummy Pattern cache entry.  Stubs a pattern tile for interpreter when
    device handles high level patterns. */
 int gx_pattern_cache_add_dummy_entry(gs_gstate *pgs, gs_pattern1_instance_t *pinst,
diff --git a/psi/zpcolor.c b/psi/zpcolor.c
index 037ddaf..4f8b10c 100644
--- a/psi/zpcolor.c
+++ b/psi/zpcolor.c
@@ -379,7 +379,7 @@ pattern_paint_finish(i_ctx_t *i_ctx_p)
                 }
             }
         }
-        code = gx_pattern_cache_add_entry(igs, pdev, &ctile);
+        code = gx_pattern_cache_add_entry(igs, pdev, &ctile, igs);
         if (code < 0)
             return code;
     }


Summary of changes:
 base/gxpcmap.c  | 10 ++++++----
 base/gxpcolor.h |  2 +-
 psi/zpcolor.c   |  2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)