summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-07-18 22:36:16 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-07-18 22:36:16 +0000
commit8351efb3686d119e862f6e8d7199ebacd812a3ce (patch)
treef47014283c470641e3a0492910a5f54cef17168c
parenta91a56bce2e7db1918095a483776775006a13277 (diff)
Avoid invoking gs operation for an empty ExtGState. (S. Hirata)
git-svn-id: svn://tug.org/texlive/trunk@55869 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog4
-rw-r--r--Build/source/texk/dvipdfm-x/pdfdraw.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index 8821f2b2293..46dd130ed8c 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,7 @@
+2020-07-19 Shunsaku Hirata <shunsaku.hirata74@gmail.com>
+
+ * pdfdraw.c: Avoid invoking gs operation for an empty ExtGState.
+
2020-07-18 Shunsaku Hirata <shunsaku.hirata74@gmail.com>
* dvipdfmx.c, pdfximage.[ch]: Don't call ordinary functions
diff --git a/Build/source/texk/dvipdfm-x/pdfdraw.c b/Build/source/texk/dvipdfm-x/pdfdraw.c
index 5b6ec92aa42..dceb89932e2 100644
--- a/Build/source/texk/dvipdfm-x/pdfdraw.c
+++ b/Build/source/texk/dvipdfm-x/pdfdraw.c
@@ -1155,7 +1155,7 @@ pdf_dev_reset_xgstate (int force)
pdf_gstate *gs;
pdf_obj *current, *target, *keys, *diff;
struct xgs_res *xgs;
- int i;
+ int i, need_reset = 0;
gs = m_stack_top(gss);
xgs = m_stack_top(&xgs_stack);
@@ -1191,10 +1191,12 @@ pdf_dev_reset_xgstate (int force)
is_diff = pdf_compare_object(value1, value2);
if (is_diff) {
pdf_add_dict(diff, pdf_link_obj(key), pdf_link_obj(value1));
+ need_reset = 1;
}
}
pdf_release_obj(keys);
- pdf_dev_set_xgstate(diff, target);
+ if (need_reset)
+ pdf_dev_set_xgstate(diff, target);
pdf_release_obj(diff);
pdf_release_obj(current);
pdf_release_obj(target);