aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-08 18:35:13 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-08 18:35:13 +0000
commit4bd2bdbf04f21237337616aa931e34d7c8991edc (patch)
treeade3b197e460003914d462c1eeedc93c203f181c /src/ports
parent184487c8083e4e3958f9efe6fb6a9b1d4865fdf5 (diff)
Upstream changes from Android.
Review URL: https://codereview.chromium.org/12699002 git-svn-id: http://skia.googlecode.com/svn/trunk@8045 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports')
-rw-r--r--src/ports/SkFontHost_FreeType.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index b98cdcdfb4..9422cf99d3 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -694,6 +694,13 @@ void SkFontHost::FilterRec(SkScalerContext::Rec* rec, SkTypeface*) {
#ifdef SK_BUILD_FOR_ANDROID
uint32_t SkFontHost::GetUnitsPerEm(SkFontID fontID) {
SkAutoMutexAcquire ac(gFTMutex);
+ FT_Library libInit = NULL;
+ if (gFTCount == 0) {
+ if (!InitFreetype())
+ sk_throw();
+ libInit = gFTLibrary;
+ }
+ SkAutoTCallIProc<struct FT_LibraryRec_, FT_Done_FreeType> ftLib(libInit);
SkFaceRec *rec = ref_ft_face(fontID);
uint16_t unitsPerEm = 0;