From f60c98feaf53de0ba9ea9acf4896476662d994bd Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 8 Aug 2018 18:15:53 +0200 Subject: [PATCH] [smooth] Improve tracing. * src/smooth/ftgrays.c (gray_convert_glyph_inner): Only use tracing if called the first time. (gray_convert_glyph): Updated. --- ChangeLog | 8 ++++++++ src/smooth/ftgrays.c | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73259c673..5a4bac08c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2018-08-08 Werner Lemberg + + [smooth] Improve tracing. + + * src/smooth/ftgrays.c (gray_convert_glyph_inner): Only use tracing + if called the first time. + (gray_convert_glyph): Updated. + 2018-08-08 Werner Lemberg Add internal functions `FT_Trace_Disable' and `FT_Trace_Enable'. diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index 138538080..b6598aa0e 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -1705,14 +1705,20 @@ typedef ptrdiff_t FT_PtrDist; static int - gray_convert_glyph_inner( RAS_ARG ) + gray_convert_glyph_inner( RAS_ARG, + int continued ) { volatile int error = 0; if ( ft_setjmp( ras.jump_buffer ) == 0 ) { + if ( continued ) + FT_Trace_Disable(); error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras ); + if ( continued ) + FT_Trace_Enable(); + if ( !ras.invalid ) gray_record_cell( RAS_VAR ); @@ -1747,6 +1753,8 @@ typedef ptrdiff_t FT_PtrDist; TCoord bands[32]; /* enough to accommodate bisections */ TCoord* band; + int continued = 0; + /* set up vertical bands */ if ( height > n ) @@ -1786,7 +1794,8 @@ typedef ptrdiff_t FT_PtrDist; ras.min_ey = band[1]; ras.max_ey = band[0]; - error = gray_convert_glyph_inner( RAS_VAR ); + error = gray_convert_glyph_inner( RAS_VAR, continued ); + continued = 1; if ( !error ) {