提交 6ffc007b 编写于 作者: B Behdad Esfahbod

[otlayout] Optimize inplace

See thread started by Jonathan with subject "an optimization for complex
fonts".
上级 71b4c999
...@@ -783,6 +783,7 @@ hb_ot_layout_get_size_params (hb_face_t *face, ...@@ -783,6 +783,7 @@ hb_ot_layout_get_size_params (hb_face_t *face,
struct GSUBProxy struct GSUBProxy
{ {
static const unsigned int table_index = 0; static const unsigned int table_index = 0;
static const bool inplace = false;
typedef OT::SubstLookup Lookup; typedef OT::SubstLookup Lookup;
GSUBProxy (hb_face_t *face) : GSUBProxy (hb_face_t *face) :
...@@ -796,6 +797,7 @@ struct GSUBProxy ...@@ -796,6 +797,7 @@ struct GSUBProxy
struct GPOSProxy struct GPOSProxy
{ {
static const unsigned int table_index = 1; static const unsigned int table_index = 1;
static const bool inplace = true;
typedef OT::PosLookup Lookup; typedef OT::PosLookup Lookup;
GPOSProxy (hb_face_t *face) : GPOSProxy (hb_face_t *face) :
...@@ -823,8 +825,6 @@ apply_string (OT::hb_apply_context_t *c, ...@@ -823,8 +825,6 @@ apply_string (OT::hb_apply_context_t *c,
const hb_ot_layout_lookup_accelerator_t &accel) const hb_ot_layout_lookup_accelerator_t &accel)
{ {
bool ret = false; bool ret = false;
OT::hb_is_inplace_context_t inplace_c (c->face);
bool inplace = lookup.is_inplace (&inplace_c);
hb_buffer_t *buffer = c->buffer; hb_buffer_t *buffer = c->buffer;
if (unlikely (!buffer->len || !c->lookup_mask)) if (unlikely (!buffer->len || !c->lookup_mask))
...@@ -850,7 +850,7 @@ apply_string (OT::hb_apply_context_t *c, ...@@ -850,7 +850,7 @@ apply_string (OT::hb_apply_context_t *c,
} }
if (ret) if (ret)
{ {
if (!inplace) if (!Proxy::inplace)
buffer->swap_buffers (); buffer->swap_buffers ();
else else
assert (!buffer->has_separate_output ()); assert (!buffer->has_separate_output ());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册