Don't call FT_Set_Transform/FT_Set_Pixel_Sizes if values have not changed.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21335 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2006-11-27 17:33:59 +00:00
parent a378f3edaf
commit 42e4745f17
1 changed files with 10 additions and 0 deletions

View File

@ -90,6 +90,13 @@ ass_font_t* ass_font_new(FT_Library ftlibrary, void* fc_priv, ass_font_desc_t* d
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 @@ void ass_font_set_transform(ass_font_t* font, FT_Matrix* m, FT_Vector* v)
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)