From 77fde472621c6ef263f9b5a7678e3a8677a2eb46 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 1 Sep 2015 14:21:31 +0200 Subject: coretext: always use lazy loading We already decided that eager loading is too slow. No need to keep multiple code paths around. --- libass/ass_coretext.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'libass') diff --git a/libass/ass_coretext.c b/libass/ass_coretext.c index 96c503d..0e94366 100644 --- a/libass/ass_coretext.c +++ b/libass/ass_coretext.c @@ -23,9 +23,6 @@ #include "ass_coretext.h" -#define CT_FONTS_EAGER_LOAD 0 -#define CT_FONTS_LAZY_LOAD !CT_FONTS_EAGER_LOAD - static char *cfstr2buf(CFStringRef string) { const int encoding = kCFStringEncodingUTF8; @@ -201,21 +198,6 @@ static void process_descriptors(ASS_FontProvider *provider, CFArrayRef fontsd) } } -#if CT_FONTS_EAGER_LOAD -static void scan_fonts(ASS_Library *lib, ASS_FontProvider *provider) -{ - - CTFontCollectionRef coll = CTFontCollectionCreateFromAvailableFonts(NULL); - CFArrayRef fontsd = CTFontCollectionCreateMatchingFontDescriptors(coll); - - process_descriptors(provider, fontsd); - - CFRelease(fontsd); - CFRelease(coll); -} -#endif - -#if CT_FONTS_LAZY_LOAD static void match_fonts(ASS_Library *lib, ASS_FontProvider *provider, char *name) { @@ -260,7 +242,6 @@ static void match_fonts(ASS_Library *lib, ASS_FontProvider *provider, CFRelease(descriptors); CFRelease(cfname); } -#endif static char *get_fallback(void *priv, const char *family, uint32_t codepoint) { @@ -288,9 +269,7 @@ static char *get_fallback(void *priv, const char *family, uint32_t codepoint) static ASS_FontProviderFuncs coretext_callbacks = { .check_glyph = check_glyph, .destroy_font = destroy_font, -#if !CT_FONTS_EAGER_LOAD .match_fonts = match_fonts, -#endif .get_fallback = get_fallback, }; @@ -298,12 +277,5 @@ ASS_FontProvider * ass_coretext_add_provider(ASS_Library *lib, ASS_FontSelector *selector, const char *config) { - ASS_FontProvider *provider = - ass_font_provider_new(selector, &coretext_callbacks, NULL); - -#if CT_FONTS_EAGER_LOAD - scan_fonts(lib, provider); -#endif - - return provider; + return ass_font_provider_new(selector, &coretext_callbacks, NULL); } -- cgit v1.2.3