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

Side by Side Diff: third_party/harfbuzz-ng/src/hb-shaper.cc

Issue 1408003004: Roll harfbuzz-ng to 1.0.5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years, 2 months 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
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-shape-plan.cc ('k') | third_party/harfbuzz-ng/src/hb-unicode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 if (unlikely (!shapers)) 58 if (unlikely (!shapers))
59 { 59 {
60 char *env = getenv ("HB_SHAPER_LIST"); 60 char *env = getenv ("HB_SHAPER_LIST");
61 if (!env || !*env) { 61 if (!env || !*env) {
62 (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]); 62 (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]);
63 return (const hb_shaper_pair_t *) all_shapers; 63 return (const hb_shaper_pair_t *) all_shapers;
64 } 64 }
65 65
66 /* Not found; allocate one. */ 66 /* Not found; allocate one. */
67 shapers = (hb_shaper_pair_t *) malloc (sizeof (all_shapers)); 67 shapers = (hb_shaper_pair_t *) calloc (1, sizeof (all_shapers));
68 if (unlikely (!shapers)) { 68 if (unlikely (!shapers)) {
69 (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]); 69 (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]);
70 return (const hb_shaper_pair_t *) all_shapers; 70 return (const hb_shaper_pair_t *) all_shapers;
71 } 71 }
72 72
73 memcpy (shapers, all_shapers, sizeof (all_shapers)); 73 memcpy (shapers, all_shapers, sizeof (all_shapers));
74 74
75 /* Reorder shaper list to prefer requested shapers. */ 75 /* Reorder shaper list to prefer requested shapers. */
76 unsigned int i = 0; 76 unsigned int i = 0;
77 char *end, *p = env; 77 char *end, *p = env;
(...skipping 24 matching lines...) Expand all
102 goto retry; 102 goto retry;
103 } 103 }
104 104
105 #ifdef HB_USE_ATEXIT 105 #ifdef HB_USE_ATEXIT
106 atexit (free_static_shapers); /* First person registers atexit() callback. * / 106 atexit (free_static_shapers); /* First person registers atexit() callback. * /
107 #endif 107 #endif
108 } 108 }
109 109
110 return shapers; 110 return shapers;
111 } 111 }
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-shape-plan.cc ('k') | third_party/harfbuzz-ng/src/hb-unicode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698