diff options
| -rw-r--r-- | core/jni/android/graphics/HarfbuzzSkia.cpp | 17 | ||||
| -rw-r--r-- | core/jni/android/graphics/TextLayoutCache.cpp | 6 |
2 files changed, 4 insertions, 19 deletions
diff --git a/core/jni/android/graphics/HarfbuzzSkia.cpp b/core/jni/android/graphics/HarfbuzzSkia.cpp index 92c743f..f6f7b45 100644 --- a/core/jni/android/graphics/HarfbuzzSkia.cpp +++ b/core/jni/android/graphics/HarfbuzzSkia.cpp @@ -211,22 +211,7 @@ const HB_FontClass harfbuzzSkiaClass = { HB_Error harfbuzzSkiaGetTable(void* voidface, const HB_Tag tag, HB_Byte* buffer, HB_UInt* len) { - FontData* data = reinterpret_cast<FontData*>(voidface); - SkTypeface* typeface = data->typeFace; - - const size_t tableSize = SkFontHost::GetTableSize(typeface->uniqueID(), tag); - if (!tableSize) - return HB_Err_Invalid_Argument; - // If Harfbuzz specified a NULL buffer then it's asking for the size of the table. - if (!buffer) { - *len = tableSize; - return HB_Err_Ok; - } - - if (*len < tableSize) - return HB_Err_Invalid_Argument; - SkFontHost::GetTableData(typeface->uniqueID(), tag, 0, tableSize, buffer); - return HB_Err_Ok; + return HB_Err_Invalid_Argument; } } // namespace android diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp index 510e541..662d918 100644 --- a/core/jni/android/graphics/TextLayoutCache.cpp +++ b/core/jni/android/graphics/TextLayoutCache.cpp @@ -346,9 +346,6 @@ void TextLayoutCacheValue::initShaperItem(HB_ShaperItem& shaperItem, HB_FontRec* font->x_scale = 1; font->y_scale = 1; - shaperItem.font = font; - shaperItem.face = HB_NewFace(shaperItem.font, harfbuzzSkiaGetTable); - // Reset kerning shaperItem.kerning_applied = false; @@ -360,8 +357,11 @@ void TextLayoutCacheValue::initShaperItem(HB_ShaperItem& shaperItem, HB_FontRec* fontData->flags = paint->getFlags(); fontData->hinting = paint->getHinting(); + shaperItem.font = font; shaperItem.font->userData = fontData; + shaperItem.face = HB_NewFace(NULL, harfbuzzSkiaGetTable); + // We cannot know, ahead of time, how many glyphs a given script run // will produce. We take a guess that script runs will not produce more // than twice as many glyphs as there are code points plus a bit of |
