Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: third_party/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh

Issue 70193010: Update harfbuzz-ng to 0.9.24 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright © 2012 Google, Inc. 2 * Copyright © 2012 Google, Inc.
3 * 3 *
4 * This is part of HarfBuzz, a text shaping library. 4 * This is part of HarfBuzz, a text shaping library.
5 * 5 *
6 * Permission is hereby granted, without written agreement and without 6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this 7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the 8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in 9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software. 10 * all copies of this software.
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 else 192 else
193 return arabic_fallback_synthesize_lookup_ligature (plan, font); 193 return arabic_fallback_synthesize_lookup_ligature (plan, font);
194 } 194 }
195 195
196 struct arabic_fallback_plan_t 196 struct arabic_fallback_plan_t
197 { 197 {
198 ASSERT_POD (); 198 ASSERT_POD ();
199 199
200 hb_mask_t mask_array[ARABIC_NUM_FALLBACK_FEATURES]; 200 hb_mask_t mask_array[ARABIC_NUM_FALLBACK_FEATURES];
201 OT::SubstLookup *lookup_array[ARABIC_NUM_FALLBACK_FEATURES]; 201 OT::SubstLookup *lookup_array[ARABIC_NUM_FALLBACK_FEATURES];
202 hb_set_digest_t digest_array[ARABIC_NUM_FALLBACK_FEATURES]; 202 hb_ot_layout_lookup_accelerator_t accel_array[ARABIC_NUM_FALLBACK_FEATURES];
203 }; 203 };
204 204
205 static const arabic_fallback_plan_t arabic_fallback_plan_nil = {}; 205 static const arabic_fallback_plan_t arabic_fallback_plan_nil = {};
206 206
207 static arabic_fallback_plan_t * 207 static arabic_fallback_plan_t *
208 arabic_fallback_plan_create (const hb_ot_shape_plan_t *plan, 208 arabic_fallback_plan_create (const hb_ot_shape_plan_t *plan,
209 hb_font_t *font) 209 hb_font_t *font)
210 { 210 {
211 arabic_fallback_plan_t *fallback_plan = (arabic_fallback_plan_t *) calloc (1, sizeof (arabic_fallback_plan_t)); 211 arabic_fallback_plan_t *fallback_plan = (arabic_fallback_plan_t *) calloc (1, sizeof (arabic_fallback_plan_t));
212 if (unlikely (!fallback_plan)) 212 if (unlikely (!fallback_plan))
213 return const_cast<arabic_fallback_plan_t *> (&arabic_fallback_plan_nil); 213 return const_cast<arabic_fallback_plan_t *> (&arabic_fallback_plan_nil);
214 214
215 for (unsigned int i = 0; i < ARABIC_NUM_FALLBACK_FEATURES; i++) 215 for (unsigned int i = 0; i < ARABIC_NUM_FALLBACK_FEATURES; i++)
216 { 216 {
217 fallback_plan->digest_array[i].init ();
218 fallback_plan->mask_array[i] = plan->map.get_1_mask (arabic_fallback_feature s[i]); 217 fallback_plan->mask_array[i] = plan->map.get_1_mask (arabic_fallback_feature s[i]);
219 if (fallback_plan->mask_array[i]) { 218 if (fallback_plan->mask_array[i]) {
220 fallback_plan->lookup_array[i] = arabic_fallback_synthesize_lookup (plan, font, i); 219 fallback_plan->lookup_array[i] = arabic_fallback_synthesize_lookup (plan, font, i);
221 if (fallback_plan->lookup_array[i]) 220 if (fallback_plan->lookup_array[i])
222 » fallback_plan->lookup_array[i]->add_coverage (&fallback_plan->digest_arr ay[i]); 221 » fallback_plan->accel_array[i].init (*fallback_plan->lookup_array[i]);
223 } 222 }
224 } 223 }
225 224
226 return fallback_plan; 225 return fallback_plan;
227 } 226 }
228 227
229 static void 228 static void
230 arabic_fallback_plan_destroy (arabic_fallback_plan_t *fallback_plan) 229 arabic_fallback_plan_destroy (arabic_fallback_plan_t *fallback_plan)
231 { 230 {
232 if (!fallback_plan || fallback_plan == &arabic_fallback_plan_nil) 231 if (!fallback_plan || fallback_plan == &arabic_fallback_plan_nil)
233 return; 232 return;
234 233
235 for (unsigned int i = 0; i < ARABIC_NUM_FALLBACK_FEATURES; i++) 234 for (unsigned int i = 0; i < ARABIC_NUM_FALLBACK_FEATURES; i++)
236 if (fallback_plan->lookup_array[i]) 235 if (fallback_plan->lookup_array[i])
236 {
237 fallback_plan->accel_array[i].fini (fallback_plan->lookup_array[i]);
237 free (fallback_plan->lookup_array[i]); 238 free (fallback_plan->lookup_array[i]);
239 }
238 240
239 free (fallback_plan); 241 free (fallback_plan);
240 } 242 }
241 243
242 static void 244 static void
243 arabic_fallback_plan_shape (arabic_fallback_plan_t *fallback_plan, 245 arabic_fallback_plan_shape (arabic_fallback_plan_t *fallback_plan,
244 hb_font_t *font, 246 hb_font_t *font,
245 hb_buffer_t *buffer) 247 hb_buffer_t *buffer)
246 { 248 {
249 OT::hb_apply_context_t c (0, font, buffer);
247 for (unsigned int i = 0; i < ARABIC_NUM_FALLBACK_FEATURES; i++) 250 for (unsigned int i = 0; i < ARABIC_NUM_FALLBACK_FEATURES; i++)
248 if (fallback_plan->lookup_array[i]) { 251 if (fallback_plan->lookup_array[i]) {
249 OT::hb_apply_context_t c (0, font, buffer, fallback_plan->mask_array[i], t rue/*auto_zwj*/); 252 c.set_lookup_mask (fallback_plan->mask_array[i]);
250 fallback_plan->lookup_array[i]->apply_string (&c, &fallback_plan->digest_a rray[i]); 253 hb_ot_layout_substitute_lookup (&c,
254 » » » » *fallback_plan->lookup_array[i],
255 » » » » fallback_plan->accel_array[i]);
251 } 256 }
252 } 257 }
253 258
254 259
255 #endif /* HB_OT_SHAPE_COMPLEX_ARABIC_FALLBACK_HH */ 260 #endif /* HB_OT_SHAPE_COMPLEX_ARABIC_FALLBACK_HH */
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc ('k') | third_party/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698