[autofit] Make debugging stuff work again.

The interface to ftgrid was broken in the series of commits starting
with

  [autofit] Allocate AF_Loader on the stack instead of AF_Module.

from 2015-01-14.

* src/autofit/afmodule.c (_af_debug_hints_rec) [FT_DEBUG_AUTOFIT]:
Use a global AF_GlyphHintsRec object for debugging.
(af_autofitter_done, af_autofitter_load_glyph): Updated.

* src/autofit/afloader.c (af_loader_init, af_loader_done): Updated.
This commit is contained in:
Werner Lemberg 2015-04-01 13:30:55 +02:00
parent 16217e5f22
commit db8df797d0
3 changed files with 57 additions and 11 deletions

View File

@ -1,3 +1,20 @@
2015-04-01 Werner Lemberg <wl@gnu.org>
[autofit] Make debugging stuff work again.
The interface to ftgrid was broken in the series of commits starting
with
[autofit] Allocate AF_Loader on the stack instead of AF_Module.
from 2015-01-14.
* src/autofit/afmodule.c (_af_debug_hints_rec) [FT_DEBUG_AUTOFIT]:
Use a global AF_GlyphHintsRec object for debugging.
(af_autofitter_done, af_autofitter_load_glyph): Updated.
* src/autofit/afloader.c (af_loader_init, af_loader_done): Updated.
2015-04-01 Werner Lemberg <wl@gnu.org>
* src/autofit/afhints.c (af_glyph_hints_done): Fix minor thinko.

View File

@ -33,9 +33,6 @@
FT_ZERO( loader );
loader->hints = hints;
#ifdef FT_DEBUG_AUTOFIT
_af_debug_hints = loader->hints;
#endif
}
@ -76,10 +73,6 @@
loader->face = NULL;
loader->globals = NULL;
loader->hints = NULL;
#ifdef FT_DEBUG_AUTOFIT
_af_debug_hints = NULL;
#endif
}

View File

@ -23,10 +23,14 @@
#include "afpic.h"
#ifdef FT_DEBUG_AUTOFIT
int _af_debug_disable_horz_hints;
int _af_debug_disable_vert_hints;
int _af_debug_disable_blue_hints;
void* _af_debug_hints;
int _af_debug_disable_horz_hints;
int _af_debug_disable_vert_hints;
int _af_debug_disable_blue_hints;
/* we use a global object instead of a local one for debugging */
AF_GlyphHintsRec _af_debug_hints_rec[1];
void* _af_debug_hints = _af_debug_hints_rec;
#endif
#include FT_INTERNAL_OBJECTS_H
@ -261,6 +265,11 @@
af_autofitter_done( FT_Module ft_module ) /* AF_Module */
{
FT_UNUSED( ft_module );
#ifdef FT_DEBUG_AUTOFIT
if ( _af_debug_hints_rec->memory )
af_glyph_hints_done( _af_debug_hints_rec );
#endif
}
@ -274,6 +283,31 @@
FT_Error error = FT_Err_Ok;
FT_Memory memory = module->root.library->memory;
#ifdef FT_DEBUG_AUTOFIT
/* in debug mode, we use a global object that survives this routine */
AF_GlyphHints hints = _af_debug_hints_rec;
AF_LoaderRec loader[1];
FT_UNUSED( size );
if ( hints->memory )
af_glyph_hints_done( hints );
af_glyph_hints_init( hints, memory );
af_loader_init( loader, hints );
error = af_loader_load_glyph( loader, module, slot->face,
glyph_index, load_flags );
af_loader_done( loader );
return error;
#else /* !FT_DEBUG_AUTOFIT */
AF_GlyphHintsRec hints[1];
AF_LoaderRec loader[1];
@ -290,6 +324,8 @@
af_glyph_hints_done( hints );
return error;
#endif /* !FT_DEBUG_AUTOFIT */
}