mirror of https://github.com/mpv-player/mpv
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:
parent
a378f3edaf
commit
42e4745f17
|
@ -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;
|
||||
|
@ -98,12 +105,15 @@ void ass_font_set_transform(ass_font_t* font, FT_Matrix* m, FT_Vector* v)
|
|||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue