[MPlayer-cvslog] r21364 - in trunk/libass: ass_cache.c ass_cache.h ass_render.c

eugeni subversion at mplayerhq.hu
Tue Nov 28 23:17:33 CET 2006


Author: eugeni
Date: Tue Nov 28 23:17:33 2006
New Revision: 21364

Modified:
   trunk/libass/ass_cache.c
   trunk/libass/ass_cache.h
   trunk/libass/ass_render.c

Log:
Use (ass_font_t, char code) instead of (FT_Face, glyph index) to identify
glyphs in cache.


Modified: trunk/libass/ass_cache.c
==============================================================================
--- trunk/libass/ass_cache.c	(original)
+++ trunk/libass/ass_cache.c	Tue Nov 28 23:17:33 2006
@@ -122,13 +122,13 @@
 static unsigned glyph_hash(glyph_hash_key_t* key) {
 	unsigned val = 0;
 	unsigned i;
-	for (i = 0; i < sizeof(key->face); ++i)
-		val += *(unsigned char *)(&(key->face) + i);
+	for (i = 0; i < sizeof(key->font); ++i)
+		val += *(unsigned char *)(&(key->font) + i);
 	val <<= 21;
 	
 	if (key->bitmap)   val &= 0x80000000;
 	if (key->be) val &= 0x40000000;
-	val += key->index;
+	val += key->ch;
 	val += key->size << 8;
 	val += key->outline << 3;
 	val += key->advance.x << 10;

Modified: trunk/libass/ass_cache.h
==============================================================================
--- trunk/libass/ass_cache.h	(original)
+++ trunk/libass/ass_cache.h	Tue Nov 28 23:17:33 2006
@@ -30,9 +30,9 @@
 // describes a glyph; glyphs with equivalents structs are considered identical
 typedef struct glyph_hash_key_s {
 	char bitmap; // bool : true = bitmap, false = outline
-	FT_Face face;
+	ass_font_t* font;
 	int size; // font size
-	int index; // glyph index in the face
+	uint32_t ch; // character code
 	unsigned outline; // border width, 16.16 fixed point value
 	int bold, italic;
 	char be; // blur edges

Modified: trunk/libass/ass_render.c
==============================================================================
--- trunk/libass/ass_render.c	(original)
+++ trunk/libass/ass_render.c	Tue Nov 28 23:17:33 2006
@@ -1196,15 +1196,15 @@
  * \param advance advance vector of the extracted glyph
  * \return 0 on success
  */
-static int get_glyph(int index, int symbol, glyph_info_t* info, FT_Vector* advance)
+static int get_glyph(int symbol, glyph_info_t* info, FT_Vector* advance)
 {
 	int error;
 	glyph_hash_val_t* val;
 	glyph_hash_key_t* key = &(info->hash_key);
 	
-	key->face = render_context.font->face;
+	key->font = render_context.font;
 	key->size = render_context.font_size;
-	key->index = index;
+	key->ch = symbol;
 	key->outline = (render_context.border * 0xFFFF); // convert to 16.16
 	key->scale_x = (render_context.scale_x * 0xFFFF);
 	key->scale_y = (render_context.scale_y * 0xFFFF);
@@ -1625,7 +1625,7 @@
 			ass_font_set_transform(render_context.font, &matrix, &shift );
 		}
 		
-		error = get_glyph(glyph_index, code, text_info.glyphs + text_info.length, &shift);
+		error = get_glyph(code, text_info.glyphs + text_info.length, &shift);
 
 		if (error) {
 			continue;



More information about the MPlayer-cvslog mailing list