Add 1-param passthrough constructor to hb_auto_t<>
And use.
This commit is contained in:
parent
c8cfb702e9
commit
ddea4d19cf
|
@ -492,6 +492,7 @@ template <typename Type>
|
|||
struct hb_auto_t : Type
|
||||
{
|
||||
hb_auto_t (void) { Type::init (); }
|
||||
template <typename T1> hb_auto_t (T1 t1) { Type::init (t1); }
|
||||
~hb_auto_t (void) { Type::fini (); }
|
||||
private: /* Hide */
|
||||
void init (void) {}
|
||||
|
|
|
@ -243,6 +243,7 @@ struct CmapSubtableFormat4
|
|||
glyphIdArray = idRangeOffset + segCount;
|
||||
glyphIdArrayLength = (subtable->length - 16 - 8 * segCount) / 2;
|
||||
}
|
||||
inline void fini (void) {}
|
||||
|
||||
inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
|
||||
{
|
||||
|
@ -313,14 +314,12 @@ struct CmapSubtableFormat4
|
|||
|
||||
inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
|
||||
{
|
||||
accelerator_t accel;
|
||||
accel.init (this);
|
||||
hb_auto_t<accelerator_t> accel (this);
|
||||
return accel.get_glyph_func (&accel, codepoint, glyph);
|
||||
}
|
||||
inline void collect_unicodes (hb_set_t *out) const
|
||||
{
|
||||
accelerator_t accel;
|
||||
accel.init (this);
|
||||
hb_auto_t<accelerator_t> accel (this);
|
||||
accel.collect_unicodes (out);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue