src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-fallback.hh
changeset 50352 25db2c8f3cf8
parent 48374 865d39b662a5
child 54232 7c11a7cc7c1d
equal deleted inserted replaced
50351:9289c4214a35 50352:25db2c8f3cf8
    75   if (!num_glyphs)
    75   if (!num_glyphs)
    76     return nullptr;
    76     return nullptr;
    77 
    77 
    78   /* Bubble-sort or something equally good!
    78   /* Bubble-sort or something equally good!
    79    * May not be good-enough for presidential candidate interviews, but good-enough for us... */
    79    * May not be good-enough for presidential candidate interviews, but good-enough for us... */
    80 
       
    81 #if defined(_AIX)
       
    82   /* Workaround AIX xlC 12 compilation problems caused by the overloaded versions of 'cmp' in IntType */
       
    83   hb_stable_sort (&glyphs[0], num_glyphs, (int(*)(const OT::GlyphID*, const OT::GlyphID *)) OT::GlyphID::cmp, &substitutes[0]);
    80   hb_stable_sort (&glyphs[0], num_glyphs, (int(*)(const OT::GlyphID*, const OT::GlyphID *)) OT::GlyphID::cmp, &substitutes[0]);
    84 #else
       
    85   hb_stable_sort (&glyphs[0], num_glyphs, OT::GlyphID::cmp, &substitutes[0]);
       
    86 #endif
       
    87 
    81 
    88   OT::Supplier<OT::GlyphID> glyphs_supplier      (glyphs, num_glyphs);
    82   OT::Supplier<OT::GlyphID> glyphs_supplier      (glyphs, num_glyphs);
    89   OT::Supplier<OT::GlyphID> substitutes_supplier (substitutes, num_glyphs);
    83   OT::Supplier<OT::GlyphID> substitutes_supplier (substitutes, num_glyphs);
    90 
    84 
    91   /* Each glyph takes four bytes max, and there's some overhead. */
    85   /* Each glyph takes four bytes max, and there's some overhead. */
   130     first_glyphs[num_first_glyphs].set (first_glyph);
   124     first_glyphs[num_first_glyphs].set (first_glyph);
   131     ligature_per_first_glyph_count_list[num_first_glyphs] = 0;
   125     ligature_per_first_glyph_count_list[num_first_glyphs] = 0;
   132     first_glyphs_indirection[num_first_glyphs] = first_glyph_idx;
   126     first_glyphs_indirection[num_first_glyphs] = first_glyph_idx;
   133     num_first_glyphs++;
   127     num_first_glyphs++;
   134   }
   128   }
   135 
   129   hb_stable_sort (&first_glyphs[0], num_first_glyphs, (int(*)(const OT::GlyphID*, const OT::GlyphID *)) OT::GlyphID::cmp, &first_glyphs_indirection[0]);
   136 #if defined(_AIX)
       
   137   /* Workaround AIX xlC 12 compilation problems caused by the overloaded versions of 'cmp' in IntType */
       
   138   hb_stable_sort (&first_glyphs[0], num_first_glyphs, (int(*)(const OT::GlyphID *, const OT::GlyphID *)) OT::GlyphID::cmp, &first_glyphs_indirection[0]);
       
   139 #else
       
   140   hb_stable_sort (&first_glyphs[0], num_first_glyphs, OT::GlyphID::cmp, &first_glyphs_indirection[0]);
       
   141 #endif
       
   142 
   130 
   143   /* Now that the first-glyphs are sorted, walk again, populate ligatures. */
   131   /* Now that the first-glyphs are sorted, walk again, populate ligatures. */
   144   for (unsigned int i = 0; i < num_first_glyphs; i++)
   132   for (unsigned int i = 0; i < num_first_glyphs; i++)
   145   {
   133   {
   146     unsigned int first_glyph_idx = first_glyphs_indirection[i];
   134     unsigned int first_glyph_idx = first_glyphs_indirection[i];
   350 static void
   338 static void
   351 arabic_fallback_plan_shape (arabic_fallback_plan_t *fallback_plan,
   339 arabic_fallback_plan_shape (arabic_fallback_plan_t *fallback_plan,
   352                             hb_font_t *font,
   340                             hb_font_t *font,
   353                             hb_buffer_t *buffer)
   341                             hb_buffer_t *buffer)
   354 {
   342 {
   355   OT::hb_apply_context_t c (0, font, buffer);
   343   OT::hb_ot_apply_context_t c (0, font, buffer);
   356   for (unsigned int i = 0; i < fallback_plan->num_lookups; i++)
   344   for (unsigned int i = 0; i < fallback_plan->num_lookups; i++)
   357     if (fallback_plan->lookup_array[i]) {
   345     if (fallback_plan->lookup_array[i]) {
   358       c.set_lookup_mask (fallback_plan->mask_array[i]);
   346       c.set_lookup_mask (fallback_plan->mask_array[i]);
   359       hb_ot_layout_substitute_lookup (&c,
   347       hb_ot_layout_substitute_lookup (&c,
   360                                       *fallback_plan->lookup_array[i],
   348                                       *fallback_plan->lookup_array[i],