[HarfBuzz] an optimization for complex fonts

Behdad Esfahbod behdad at behdad.org
Mon Oct 28 08:42:21 PDT 2013


On 13-10-28 04:21 PM, Jonathan Kew wrote:
> On 28/10/13 14:47, Behdad Esfahbod wrote:
>> On 13-10-28 02:47 PM, Jonathan Kew wrote:
>>
>>> See what you think. An alternative implementation might be to initialize the
>>> is_inplace flag during hb_ot_layout_lookup_accelerator_t::init() (then no need
>>> for the _initialized flag, hence taking an if() out of the hot path, and the
>>> hb_ot_layout_lookup_accelerator_t references could remain const), but it
>>> looked like this would involve rather more rearrangement of code, so I took
>>> the simplest approach for now.
>>
>> Actually, looks like we can safely just replace the inplace variable with "are
>> we in GPOS".  Can you try the attached patch?
>>
> 
> Won't this cause us to swap buffers for *all* GSUB lookups, whereas currently
> we execute many of them (e.g. single substitutions) without doing a swap?

swap_buffers() is very very light for in-place substitutions.  That said, I
don't mind caching inplace().

-- 
behdad
http://behdad.org/



More information about the HarfBuzz mailing list