“e53a48b46a143217a39b5f1c9125c4a7d507d2b5”上不存在“paddle/memory/memcpy.cc”
提交 e0f16a71 编写于 作者: B Behdad Esfahbod

[ot-font] Towards accelerating get_glyph()

上级 5473ebfb
...@@ -201,9 +201,24 @@ struct hb_ot_face_glyf_accelerator_t ...@@ -201,9 +201,24 @@ struct hb_ot_face_glyf_accelerator_t
} }
}; };
typedef bool (*hb_cmap_get_glyph_func_t) (const void *obj,
hb_codepoint_t codepoint,
hb_codepoint_t *glyph);
template <typename Type>
static inline bool get_glyph_from (const void *obj,
hb_codepoint_t codepoint,
hb_codepoint_t *glyph)
{
const Type *typed_obj = (const Type *) obj;
return typed_obj->get_glyph (codepoint, glyph);
}
struct hb_ot_face_cmap_accelerator_t struct hb_ot_face_cmap_accelerator_t
{ {
const OT::CmapSubtable *table; hb_cmap_get_glyph_func_t get_glyph_func;
const void *get_glyph_data;
const OT::CmapSubtableFormat14 *uvs_table; const OT::CmapSubtableFormat14 *uvs_table;
hb_blob_t *blob; hb_blob_t *blob;
...@@ -238,8 +253,10 @@ struct hb_ot_face_cmap_accelerator_t ...@@ -238,8 +253,10 @@ struct hb_ot_face_cmap_accelerator_t
/* Meh. */ /* Meh. */
if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtableFormat14); if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtableFormat14);
this->table = subtable;
this->uvs_table = subtable_uvs; this->uvs_table = subtable_uvs;
this->get_glyph_func = get_glyph_from<OT::CmapSubtable>;
this->get_glyph_data = subtable;
} }
inline void fini (void) inline void fini (void)
...@@ -250,7 +267,7 @@ struct hb_ot_face_cmap_accelerator_t ...@@ -250,7 +267,7 @@ struct hb_ot_face_cmap_accelerator_t
inline bool get_nominal_glyph (hb_codepoint_t unicode, inline bool get_nominal_glyph (hb_codepoint_t unicode,
hb_codepoint_t *glyph) const hb_codepoint_t *glyph) const
{ {
return this->table->get_glyph (unicode, glyph); return this->get_glyph_func (this->get_glyph_data, unicode, glyph);
} }
inline bool get_variation_glyph (hb_codepoint_t unicode, inline bool get_variation_glyph (hb_codepoint_t unicode,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册