Add support in Android for AdvancedTypefaceMetrics
authordjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 16 Nov 2011 17:00:46 +0000 (17:00 +0000)
committerdjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 16 Nov 2011 17:00:46 +0000 (17:00 +0000)
Review URL: http://codereview.appspot.com/5396045

git-svn-id: http://skia.googlecode.com/svn/trunk@2698 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkAdvancedTypefaceMetrics.cpp
src/ports/SkFontHost_FreeType.cpp

index fbbed0c370d14630bef1cfbdb5f68b951f9a6dad..8af70fb902d8c11344b9df2e9454272109136dba 100644 (file)
@@ -10,7 +10,7 @@
 #include "SkAdvancedTypefaceMetrics.h"
 #include "SkTypes.h"
 
-#ifdef SK_BUILD_FOR_UNIX
+#if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #endif
@@ -258,7 +258,7 @@ template SkAdvancedTypefaceMetrics::WidthRange* getAdvanceData(
         const uint32_t* subsetGlyphIDs,
         uint32_t subsetGlyphIDsLength,
         bool (*getAdvance)(HDC hdc, int gId, int16_t* data));
-#elif defined(SK_BUILD_FOR_UNIX)
+#elif defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
 template SkAdvancedTypefaceMetrics::WidthRange* getAdvanceData(
         FT_Face face,
         int num_glyphs,
index f20b26af8d3010fc6f5346ec59b6c7a29673d823..bb9b22043fa6eb6bf0788f85b137f4153860c26a 100644 (file)
@@ -414,7 +414,7 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
         SkAdvancedTypefaceMetrics::PerGlyphInfo perGlyphInfo,
         const uint32_t* glyphIDs,
         uint32_t glyphIDsCount) {
-#if defined(SK_BUILD_FOR_MAC) || defined(ANDROID)
+#if defined(SK_BUILD_FOR_MAC)
     return NULL;
 #else
     SkAutoMutexAcquire ac(gFTMutex);
@@ -641,7 +641,7 @@ void SkFontHost::FilterRec(SkScalerContext::Rec* rec) {
     rec->setHinting(h);
 }
 
-#ifdef ANDROID
+#ifdef SK_BUILD_FOR_ANDROID
 uint32_t SkFontHost::GetUnitsPerEm(SkFontID fontID) {
     SkAutoMutexAcquire ac(gFTMutex);
     SkFaceRec *rec = ref_ft_face(fontID);