[MPlayer-cvslog] r23043 - in trunk/libass: ass_cache.c ass_cache.h ass_render.c
eugeni
subversion at mplayerhq.hu
Sat Apr 21 01:13:34 CEST 2007
Author: eugeni
Date: Sat Apr 21 01:13:34 2007
New Revision: 23043
Modified:
trunk/libass/ass_cache.c
trunk/libass/ass_cache.h
trunk/libass/ass_render.c
Log:
Store outline_glyph (glyph border) in glyph cache.
Modified: trunk/libass/ass_cache.c
==============================================================================
--- trunk/libass/ass_cache.c (original)
+++ trunk/libass/ass_cache.c Sat Apr 21 01:13:34 2007
@@ -283,6 +283,7 @@ static void glyph_hash_dtor(void* key, s
{
glyph_hash_val_t* v = value;
if (v->glyph) FT_Done_Glyph(v->glyph);
+ if (v->outline_glyph) FT_Done_Glyph(v->outline_glyph);
free(key);
free(value);
}
Modified: trunk/libass/ass_cache.h
==============================================================================
--- trunk/libass/ass_cache.h (original)
+++ trunk/libass/ass_cache.h Sat Apr 21 01:13:34 2007
@@ -69,6 +69,7 @@ typedef struct glyph_hash_key_s {
typedef struct glyph_hash_val_s {
FT_Glyph glyph;
+ FT_Glyph outline_glyph;
FT_BBox bbox_scaled; // bbox after scaling, but before rotation
FT_Vector advance; // 26.6, advance distance to the next bitmap in line
} glyph_hash_val_t;
Modified: trunk/libass/ass_render.c
==============================================================================
--- trunk/libass/ass_render.c (original)
+++ trunk/libass/ass_render.c Sat Apr 21 01:13:34 2007
@@ -1243,6 +1243,7 @@ static void get_outline_glyph(int symbol
val = cache_find_glyph(&key);
if (val) {
FT_Glyph_Copy(val->glyph, &info->glyph);
+ FT_Glyph_Copy(val->outline_glyph, &info->outline_glyph);
info->bbox = val->bbox_scaled;
info->advance.x = val->advance.x;
info->advance.y = val->advance.y;
@@ -1255,19 +1256,20 @@ static void get_outline_glyph(int symbol
info->advance.y = d16_to_d6(info->glyph->advance.y);
FT_Glyph_Get_CBox( info->glyph, FT_GLYPH_BBOX_PIXELS, &info->bbox);
+ if (render_context.stroker) {
+ info->outline_glyph = info->glyph;
+ error = FT_Glyph_StrokeBorder( &(info->outline_glyph), render_context.stroker, 0 , 0 ); // don't destroy original
+ if (error) {
+ mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FT_Glyph_Stroke_Error, error);
+ }
+ }
+
FT_Glyph_Copy(info->glyph, &v.glyph);
+ FT_Glyph_Copy(info->outline_glyph, &v.outline_glyph);
v.advance = info->advance;
v.bbox_scaled = info->bbox;
cache_add_glyph(&key, &v);
}
-
- if (render_context.stroker) {
- info->outline_glyph = info->glyph;
- error = FT_Glyph_StrokeBorder( &(info->outline_glyph), render_context.stroker, 0 , 0 ); // don't destroy original
- if (error) {
- mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FT_Glyph_Stroke_Error, error);
- }
- }
}
/**
More information about the MPlayer-cvslog
mailing list