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?

-- 
behdad
http://behdad.org/
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index bd8ef08..183726e 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -783,6 +783,7 @@ hb_ot_layout_get_size_params (hb_face_t    *face,
 struct GSUBProxy
 {
   static const unsigned int table_index = 0;
+  static const bool inplace = false;
   typedef OT::SubstLookup Lookup;
 
   GSUBProxy (hb_face_t *face) :
@@ -796,6 +797,7 @@ struct GSUBProxy
 struct GPOSProxy
 {
   static const unsigned int table_index = 1;
+  static const bool inplace = true;
   typedef OT::PosLookup Lookup;
 
   GPOSProxy (hb_face_t *face) :
@@ -823,8 +825,6 @@ apply_string (OT::hb_apply_context_t *c,
 	      const hb_ot_layout_lookup_accelerator_t &accel)
 {
   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;
 
   if (unlikely (!buffer->len || !c->lookup_mask))
@@ -850,7 +850,7 @@ apply_string (OT::hb_apply_context_t *c,
     }
     if (ret)
     {
-      if (!inplace)
+      if (!Proxy::inplace)
 	buffer->swap_buffers ();
       else
         assert (!buffer->has_separate_output ());
_______________________________________________
HarfBuzz mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/harfbuzz

Reply via email to