Commit aa1b5362d36282f0157f8a7d747b305dc1838c82

Werner Lemberg 2020-12-24T08:32:04

[sdf] Fix tracing. * include/freetype/internal.fttrace.h: Add 'bsdf' component. * src/sdf/ftbsdf.c, src/sdf/ftsdf.c (FT_COMPONENT): Define.

diff --git a/ChangeLog b/ChangeLog
index ed652a9..6f377b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-12-24  Werner Lemberg  <wl@gnu.org>
+
+	[sdf] Fix tracing.
+
+	* include/freetype/internal.fttrace.h: Add 'bsdf' component.
+
+	* src/sdf/ftbsdf.c, src/sdf/ftsdf.c (FT_COMPONENT): Define.
+
 2020-08-21  Anuj Verma  <anujv@iitbhilai.ac.in>
 
 	[sdf] Add debugging function.
diff --git a/include/freetype/internal/fttrace.h b/include/freetype/internal/fttrace.h
index 39cdf36..31ea504 100644
--- a/include/freetype/internal/fttrace.h
+++ b/include/freetype/internal/fttrace.h
@@ -42,13 +42,14 @@ FT_TRACE_DEF( checksum )  /* bitmap checksum         (ftobjs.c)   */
 FT_TRACE_DEF( mm )        /* MM interface            (ftmm.c)     */
 FT_TRACE_DEF( psprops )   /* PS driver properties    (ftpsprop.c) */
 FT_TRACE_DEF( raccess )   /* resource fork accessor  (ftrfork.c)  */
+FT_TRACE_DEF( synth )     /* bold/slant synthesizer  (ftsynth.c)  */
+
+  /* rasterizers */
 FT_TRACE_DEF( raster )    /* monochrome rasterizer   (ftraster.c) */
 FT_TRACE_DEF( smooth )    /* anti-aliasing raster    (ftgrays.c)  */
-FT_TRACE_DEF( sdf )       /* signed distance raster  (ftsdf.c)    */
-FT_TRACE_DEF( synth )     /* bold/slant synthesizer  (ftsynth.c)  */
 
-  /* Cache sub-system */
-FT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */
+  /* cache sub-system */
+FT_TRACE_DEF( cache )     /* cache sub-system   (ftcache.c, etc.) */
 
   /* SFNT driver components */
 FT_TRACE_DEF( sfdriver )  /* SFNT font driver        (sfdriver.c) */
@@ -160,4 +161,8 @@ FT_TRACE_DEF( aflatin2 )
 FT_TRACE_DEF( afshaper )
 FT_TRACE_DEF( afwarp )
 
+  /* SDF components */
+FT_TRACE_DEF( sdf )       /* signed distance raster for outlines (ftsdf.c) */
+FT_TRACE_DEF( bsdf )      /* signed distance raster for bitmaps (ftbsdf.c) */
+
 /* END */
diff --git a/src/sdf/ftbsdf.c b/src/sdf/ftbsdf.c
index dd28c50..396b6c9 100644
--- a/src/sdf/ftbsdf.c
+++ b/src/sdf/ftbsdf.c
@@ -119,6 +119,16 @@
 
   /**************************************************************************
    *
+   * The macro FT_COMPONENT is used in trace mode.  It is an implicit
+   * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
+   * messages during execution.
+   */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  bsdf
+
+
+  /**************************************************************************
+   *
    * useful macros
    *
    */
diff --git a/src/sdf/ftsdf.c b/src/sdf/ftsdf.c
index ef3922a..ef028d9 100644
--- a/src/sdf/ftsdf.c
+++ b/src/sdf/ftsdf.c
@@ -105,6 +105,16 @@
 
   /**************************************************************************
    *
+   * The macro FT_COMPONENT is used in trace mode.  It is an implicit
+   * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
+   * messages during execution.
+   */
+#undef  FT_COMPONENT
+#define FT_COMPONENT  sdf
+
+
+  /**************************************************************************
+   *
    * for tracking used memory
    *
    */