diff options
Diffstat (limited to 'Build/source/texk/dvipdfmx/src/pdfdraw.c')
-rw-r--r-- | Build/source/texk/dvipdfmx/src/pdfdraw.c | 120 |
1 files changed, 11 insertions, 109 deletions
diff --git a/Build/source/texk/dvipdfmx/src/pdfdraw.c b/Build/source/texk/dvipdfmx/src/pdfdraw.c index a1797d6d461..444d177d9b0 100644 --- a/Build/source/texk/dvipdfmx/src/pdfdraw.c +++ b/Build/source/texk/dvipdfmx/src/pdfdraw.c @@ -1,4 +1,4 @@ -/* $Header: /home/cvsroot/dvipdfmx/src/pdfdraw.c,v 1.11 2005/08/31 08:01:05 chofchof Exp $ +/* $Header: /home/cvsroot/dvipdfmx/src/pdfdraw.c,v 1.13 2006/12/11 12:46:03 chofchof Exp $ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. @@ -1148,44 +1148,6 @@ pdf_dev_currentcolor (pdf_color *color, int is_fill) } #endif /* 0 */ -/* Implementation of the optimization of adjacent transform - * matrices, for example, "1 0 0 1 a b cm 1 0 0 1 c d cm" results - * "1 0 0 1 a+c b+d cm". - * - * The static variable ptM holds the information of pending - * transform matrices, and it will be flushed before any non - * transform command appears. - */ -static pdf_tmatrix *ptM = NULL; -static char tmatrix_buf[1024]; /* FIXME: To avoid confliction with fmt_buf. */ - -/* pdf_dev_flushtmatrix() is called from pdf_doc_add_page_content() - * in pdfdoc.c - */ -int -pdf_dev_flushtmatrix (char **buf) -{ - int len = 0; - - if (ptM) { - *buf = tmatrix_buf; - (*buf)[len++] = ' '; - len += pdf_sprint_matrix((*buf) + len, ptM); - /* Do not flush "1 0 0 1 0 0 cm". Sting check is faster than - * checking six double variables. */ - if (!strncmp((*buf) + 1, "1 0 0 1 0 0", 11)) { - return 0; - } - (*buf)[len++] = ' '; - (*buf)[len++] = 'c'; - (*buf)[len++] = 'm'; - RELEASE(ptM); - ptM = NULL; - } - - return len; -} - int pdf_dev_concat (const pdf_tmatrix *M) { @@ -1195,6 +1157,8 @@ pdf_dev_concat (const pdf_tmatrix *M) pdf_coord *cpt = &gs->cp; pdf_tmatrix *CTM = &gs->matrix; pdf_tmatrix W; + char *buf = FORMAT_BUFF_PTR(NULL); + int len = 0; ASSERT(M); @@ -1208,12 +1172,12 @@ pdf_dev_concat (const pdf_tmatrix *M) return -1; } - if (ptM) { - pdf_concatmatrix(ptM, M); - } else { - ptM = NEW(1, pdf_tmatrix); - pdf_copymatrix(ptM, M); - } + buf[len++] = ' '; + len += pdf_sprint_matrix(buf + len, M); + buf[len++] = ' '; + buf[len++] = 'c'; + buf[len++] = 'm'; + pdf_doc_add_page_content(buf, len); pdf_concatmatrix(CTM, M); @@ -1310,11 +1274,8 @@ pdf_dev_grestore_to (int depth) pdf_dev__clean_gstate(gs); RELEASE(gs); } -#if 0 pdf_dev_reset_fonts(); -#else - pdf_dev_reset(); -#endif + pdf_dev_reset_color(); return; } @@ -1341,11 +1302,8 @@ pdf_dev_grestore (void) pdf_doc_add_page_content(" Q", 2); -#if 0 pdf_dev_reset_fonts(); -#else - pdf_dev_reset(); -#endif + pdf_dev_reset_color(); pdf_dev_setcolor(&sc, 0); pdf_dev_setcolor(&fc, 1); @@ -1353,62 +1311,6 @@ pdf_dev_grestore (void) return 0; } -#if 0 -void -pdf_dev_reset_color (void) -{ - m_stack *gss = &_gsstck; - pdf_gstate *gs = m_stack_top(gss); - pdf_color fill, stroke; - - pdf_color_copycolor(&fill, &gs->fillcolor); - pdf_color_copycolor(&stroke, &gs->strokecolor); - - /* Clear current color: */ - pdf_color_graycolor(&gs->fillcolor, 0.0); - pdf_color_graycolor(&gs->strokecolor, 0.0); - - pdf_dev_setcolor(&stroke, 0); - pdf_dev_setcolor(&fill, 1); - - return; -} - -int -pdf_dev_setcolor (const pdf_color *color, int is_fill) -{ - m_stack *gss = &_gsstck; - pdf_gstate *gs = m_stack_top(gss); - pdf_color *fcl = &gs->fillcolor; - pdf_color *scl = &gs->strokecolor; - int colormode; - pdf_color *curcol; - - if (!color) { - WARN("No color specified."); - return -1; - } - - colormode = pdf_dev_get_param(PDF_DEV_PARAM_COLORMODE); - if (!colormode) { - WARN("setcolor ignored. (Ignore color option set)"); - return 0; - } - - curcol = is_fill ? fcl : scl; - if (!pdf_color_compare_color(color, curcol)) { - return 0; - } - - graphics_mode(); - pdf_color_print_color(color, is_fill); - - pdf_color_copycolor(curcol, color); - - return 0; -} -#endif - /* * num w LW linewidth (g.t. 0) * int J LC linecap |