Commit f60c98feaf53de0ba9ea9acf4896476662d994bd

Werner Lemberg 2018-08-08T18:15:53

[smooth] Improve tracing. * src/smooth/ftgrays.c (gray_convert_glyph_inner): Only use tracing if called the first time. (gray_convert_glyph): Updated.

diff --git a/ChangeLog b/ChangeLog
index 73259c6..5a4bac0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2018-08-08  Werner Lemberg  <wl@gnu.org>
 
+	[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  <wl@gnu.org>
+
 	Add internal functions `FT_Trace_Disable' and `FT_Trace_Enable'.
 
 	It sometimes makes sense to suppress tracing informations, for
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 1385380..b6598aa 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 )
         {