[gs-commits] ghostpdl branch, pdfi, updated. jbig2dec-0.14-2209-gf47e65a

[email protected] (Nancy Durgin)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, pdfi has been updated
       via  f47e65a1b8ca8f7e3e40505a0c8778620593c069 (commit)
       via  919403b427ee85520791c674117f6d6d60d2ec89 (commit)
      from  3fecb8bcf59d4f1e93edab637a861332cf43063c (commit)

----------------------------------------------------------------------
commit f47e65a1b8ca8f7e3e40505a0c8778620593c069
Author: Nancy Durgin <[email protected]>
Date:   Thu Sep 12 10:41:49 2019 -0700

    Pass the correct channel to gs_end_transparency()
    
    Also clarified meaning of the variable, though it seems
    to do double-duty in the routine (transparency channel vs colorindex)
    
    Too bad after spending all that time tracking down this subtle
    difference between gs and gpdf, it actually seems to have no effect :(

diff --git a/pdf/pdf_trans.c b/pdf/pdf_trans.c
index b2a2b18..f712e6a 100644
--- a/pdf/pdf_trans.c
+++ b/pdf/pdf_trans.c
@@ -178,7 +178,7 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
             goto exit;
         /* TODO: Error handling... */
         code = pdfi_form_execgroup(ctx, ctx->CurrentPageDict, G_dict, igs->GroupGState);
-        code = gs_end_transparency_mask(ctx->pgs, 0);
+        code = gs_end_transparency_mask(ctx->pgs, colorindex);
         /* Put back the matrix (we couldn't just rely on gsave/grestore for whatever reason,
          * according to PS code anyway...
          */
@@ -547,20 +547,20 @@ int pdfi_trans_teardown(pdf_context *ctx, pdfi_trans_state_t *state)
 int pdfi_trans_set_params(pdf_context *ctx, double alpha)
 {
     pdfi_int_gstate *igs = (pdfi_int_gstate *)ctx->pgs->client_data;
-    int colorindex;
+    gs_transparency_channel_selector_t csel;
 
     if (ctx->page_has_transparency) {
         if (gs_getalphaisshape(ctx->pgs)) {
             gs_setshapealpha(ctx->pgs, alpha);
             gs_setopacityalpha(ctx->pgs, 1.0);
-            colorindex = 1;
+            csel = TRANSPARENCY_CHANNEL_Shape;
         } else {
             gs_setshapealpha(ctx->pgs, 1.0);
             gs_setopacityalpha(ctx->pgs, alpha);
-            colorindex = 0;
+            csel = TRANSPARENCY_CHANNEL_Opacity;
         }
         if (igs->SMask) {
-            pdfi_trans_set_mask(ctx, igs, colorindex);
+            pdfi_trans_set_mask(ctx, igs, csel);
         }
     }
 

----------------------------------------------------------------------
commit 919403b427ee85520791c674117f6d6d60d2ec89
Author: Nancy Durgin <[email protected]>
Date:   Thu Sep 12 10:38:25 2019 -0700

    Some debug fixes for mask_stack
    
    Does nothing unless DUMP_MASK_STACK is turned on at top of file

diff --git a/base/gdevp14.c b/base/gdevp14.c
index aecc354..7235e31 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -9495,8 +9495,8 @@ dump_mask_stack(pdf14_mask_t *mask_stack)
 
     while (curr_mask != NULL) {
         if_debug1m('v', curr_mask->memory, "[v]mask_level, %d\n", level);
-        if_debug1m('v', curr_mask->memory, "[v]mask_buf, %x\n", curr_mask->rc_mask->mask_buf);
-        if_debug1m('v', curr_mask->memory, "[v]rc_count, %d\n", curr_mask->rc_mask->rc);
+        if_debug1m('v', curr_mask->memory, "[v]mask_buf, %p\n", curr_mask->rc_mask->mask_buf);
+        if_debug1m('v', curr_mask->memory, "[v]rc_count, %ld\n", curr_mask->rc_mask->rc.ref_count);
         level++;
         curr_mask = curr_mask->previous;
     }
@@ -9506,13 +9506,13 @@ dump_mask_stack(pdf14_mask_t *mask_stack)
 static void
 pdf14_debug_mask_stack_state(pdf14_ctx *ctx)
 {
-    if_debug1m('v', ctx->memory, "[v]ctx_maskstack, %x\n", ctx->mask_stack);
+    if_debug1m('v', ctx->memory, "[v]ctx_maskstack, %p\n", ctx->mask_stack);
     if (ctx->mask_stack != NULL) {
         dump_mask_stack(ctx->mask_stack);
     }
-    if_debug1m('v', ctx->memory, "[v]ctx_stack, %x\n", ctx->stack);
+    if_debug1m('v', ctx->memory, "[v]ctx_stack, %p\n", ctx->stack);
     if (ctx->stack != NULL) {
-        if_debug1m('v', ctx->memory, "[v]ctx_stack_maskstack, %x\n", ctx->stack->mask_stack);
+        if_debug1m('v', ctx->memory, "[v]ctx_stack_maskstack, %p\n", ctx->stack->mask_stack);
         if (ctx->stack->mask_stack != NULL) {
             dump_mask_stack(ctx->stack->mask_stack);
         }


Summary of changes:
 base/gdevp14.c  | 10 +++++-----
 pdf/pdf_trans.c | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.