From ebc465b8f271f362015fdf352b8355989e59a3f3 Mon Sep 17 00:00:00 2001 From: khushalsagar Date: Fri, 12 Feb 2016 12:42:48 -0800 Subject: Add support for caching font files in the Android SkFontMgr. SkFontMgr_Android lazily access font files from disk, which is not possible when it is used in the renderer sandbox on Linux. Add a flag to SkFontMgr_Android_CustomFonts for caching readonly FILE streams when creating the font mgr. Since the font mgr is created before the sandbox is initialized, it can access these files on initialization, and use these cached streams safely for its lifetime. Review URL: https://codereview.chromium.org/1673373003 --- include/ports/SkFontMgr_android.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/ports') diff --git a/include/ports/SkFontMgr_android.h b/include/ports/SkFontMgr_android.h index e489b161b2..f12f51f36a 100644 --- a/include/ports/SkFontMgr_android.h +++ b/include/ports/SkFontMgr_android.h @@ -39,6 +39,11 @@ struct SkFontMgr_Android_CustomFonts { * In the new style (version > 21) fontsXml format is used, this should be NULL. */ const char* fFallbackFontsXml; + + /** Optional custom flag. If set to true the SkFontMgr will acquire all requisite + * system IO resources on initialization. + */ + bool fIsolated; }; /** Create a font manager for Android. If 'custom' is NULL, use only system fonts. */ -- cgit v1.2.3