diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2017-11-14 19:25:38 -0800 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2017-11-14 19:25:51 -0800 |
commit | 702d86ba6b4a2e41cbee46fea18b3f8eb8986dc9 (patch) | |
tree | 9424b10f29b45921195ce1a8f5656dc5782c77f1 /src/hb-ot-kern-table.hh | |
parent | 909de95a112ffe4d05ddcfed97a235763e8af068 (diff) |
[ot] Fold hb_ot_face_kern_accelerator_t
Diffstat (limited to 'src/hb-ot-kern-table.hh')
-rw-r--r-- | src/hb-ot-kern-table.hh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index 5fd2e20e..aa293b8d 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -358,17 +358,22 @@ struct kern struct accelerator_t { - inline void init (const kern *table_, unsigned int table_length_) + inline void init (hb_face_t *face) { - table = table_; - table_length = table_length_; + blob = Sanitizer<kern>::sanitize (face->reference_table (HB_OT_TAG_kern)); + table = Sanitizer<kern>::lock_instance (blob); + table_length = hb_blob_get_length (blob); + } + inline void fini (void) + { + hb_blob_destroy (blob); } - inline void fini (void) {} inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const { return table->get_h_kerning (left, right, table_length); } private: + hb_blob_t *blob; const kern *table; unsigned int table_length; }; |