summaryrefslogtreecommitdiffstats
path: root/libass/ass_font.c
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-27 17:33:59 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-27 17:33:59 +0000
commit42e4745f1728f9196c5658f72982a77bd156c4c4 (patch)
tree39a9a3e6f1223b9c2d720654ef090cc42ef32e8e /libass/ass_font.c
parenta378f3edaf570327d0e73feba94fc00d8c2dd062 (diff)
downloadmpv-42e4745f1728f9196c5658f72982a77bd156c4c4.tar.bz2
mpv-42e4745f1728f9196c5658f72982a77bd156c4c4.tar.xz
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
Diffstat (limited to 'libass/ass_font.c')
-rw-r--r--libass/ass_font.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libass/ass_font.c b/libass/ass_font.c
index 189173e6b8..4e5e834052 100644
--- a/libass/ass_font.c
+++ b/libass/ass_font.c
@@ -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)