changeset 21319:415e2119e91c

Don't call FT_Set_Transform/FT_Set_Pixel_Sizes if values have not changed.
author eugeni
date Mon, 27 Nov 2006 17:33:59 +0000
parents c012ba4bf229
children 4a7e96f1eebf
files libass/ass_font.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass_font.c	Mon Nov 27 17:22:31 2006 +0000
+++ b/libass/ass_font.c	Mon Nov 27 17:33:59 2006 +0000
@@ -90,6 +90,13 @@
 
 void ass_font_set_transform(ass_font_t* font, FT_Matrix* m, FT_Vector* v)
 {
+	if (font->m.xx != m->xx ||
+	    font->m.xy != m->xy ||
+	    font->m.yx != m->yx ||
+	    font->m.yy != m->yy ||
+	    font->v.x != v->x ||
+	    font->v.y != v->y
+	    ) {
 	font->m.xx = m->xx;
 	font->m.xy = m->xy;
 	font->m.yx = m->yx;
@@ -97,12 +104,15 @@
 	font->v.x = v->x;
 	font->v.y = v->y;
 	FT_Set_Transform(font->face, &font->m, &font->v);
+	}
 }
 
 void ass_font_set_size(ass_font_t* font, int size)
 {
+	if (font->size != size) {
 	font->size = size;
 	FT_Set_Pixel_Sizes(font->face, 0, size);
+	}
 }
 
 FT_Glyph ass_font_get_glyph(void* fontconfig_priv, ass_font_t* font, uint32_t ch)