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

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

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
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-shape.cc ('k') | third_party/harfbuzz-ng/src/hb-ucdn.cc » ('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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 #undef HB_SHAPER_PLAN 78 #undef HB_SHAPER_PLAN
79 } 79 }
80 80
81 81
82 /* 82 /*
83 * hb_shape_plan_t 83 * hb_shape_plan_t
84 */ 84 */
85 85
86 /**
87 * hb_shape_plan_create: (Xconstructor)
88 * @face:
89 * @props:
90 * @user_features: (array length=num_user_features):
91 * @num_user_features:
92 * @shaper_list: (array zero-terminated=1):
93 *
94 *
95 *
96 * Return value: (transfer full):
97 *
98 * Since: 1.0
99 **/
86 hb_shape_plan_t * 100 hb_shape_plan_t *
87 hb_shape_plan_create (hb_face_t *face, 101 hb_shape_plan_create (hb_face_t *face,
88 const hb_segment_properties_t *props, 102 const hb_segment_properties_t *props,
89 const hb_feature_t *user_features, 103 const hb_feature_t *user_features,
90 unsigned int num_user_features, 104 unsigned int num_user_features,
91 const char * const *shaper_list) 105 const char * const *shaper_list)
92 { 106 {
93 assert (props->direction != HB_DIRECTION_INVALID); 107 assert (props->direction != HB_DIRECTION_INVALID);
94 108
95 hb_shape_plan_t *shape_plan; 109 hb_shape_plan_t *shape_plan;
96 110
97 if (unlikely (!face)) 111 if (unlikely (!face))
98 face = hb_face_get_empty (); 112 face = hb_face_get_empty ();
99 if (unlikely (!props || hb_object_is_inert (face))) 113 if (unlikely (!props || hb_object_is_inert (face)))
100 return hb_shape_plan_get_empty (); 114 return hb_shape_plan_get_empty ();
101 if (!(shape_plan = hb_object_create<hb_shape_plan_t> ())) 115 if (!(shape_plan = hb_object_create<hb_shape_plan_t> ()))
102 return hb_shape_plan_get_empty (); 116 return hb_shape_plan_get_empty ();
103 117
104 hb_face_make_immutable (face); 118 hb_face_make_immutable (face);
105 shape_plan->default_shaper_list = shaper_list == NULL; 119 shape_plan->default_shaper_list = shaper_list == NULL;
106 shape_plan->face = hb_face_reference (face); 120 shape_plan->face = hb_face_reference (face);
107 shape_plan->props = *props; 121 shape_plan->props = *props;
108 122
109 hb_shape_plan_plan (shape_plan, user_features, num_user_features, shaper_list) ; 123 hb_shape_plan_plan (shape_plan, user_features, num_user_features, shaper_list) ;
110 124
111 return shape_plan; 125 return shape_plan;
112 } 126 }
113 127
128 /**
129 * hb_shape_plan_get_empty:
130 *
131 *
132 *
133 * Return value: (transfer full):
134 *
135 * Since: 1.0
136 **/
114 hb_shape_plan_t * 137 hb_shape_plan_t *
115 hb_shape_plan_get_empty (void) 138 hb_shape_plan_get_empty (void)
116 { 139 {
117 static const hb_shape_plan_t _hb_shape_plan_nil = { 140 static const hb_shape_plan_t _hb_shape_plan_nil = {
118 HB_OBJECT_HEADER_STATIC, 141 HB_OBJECT_HEADER_STATIC,
119 142
120 true, /* default_shaper_list */ 143 true, /* default_shaper_list */
121 NULL, /* face */ 144 NULL, /* face */
122 HB_SEGMENT_PROPERTIES_DEFAULT, /* props */ 145 HB_SEGMENT_PROPERTIES_DEFAULT, /* props */
123 146
124 NULL, /* shaper_func */ 147 NULL, /* shaper_func */
125 NULL, /* shaper_name */ 148 NULL, /* shaper_name */
126 149
127 { 150 {
128 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID, 151 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
129 #include "hb-shaper-list.hh" 152 #include "hb-shaper-list.hh"
130 #undef HB_SHAPER_IMPLEMENT 153 #undef HB_SHAPER_IMPLEMENT
131 } 154 }
132 }; 155 };
133 156
134 return const_cast<hb_shape_plan_t *> (&_hb_shape_plan_nil); 157 return const_cast<hb_shape_plan_t *> (&_hb_shape_plan_nil);
135 } 158 }
136 159
160 /**
161 * hb_shape_plan_reference: (skip)
162 * @shape_plan: a shape plan.
163 *
164 *
165 *
166 * Return value: (transfer full):
167 *
168 * Since: 1.0
169 **/
137 hb_shape_plan_t * 170 hb_shape_plan_t *
138 hb_shape_plan_reference (hb_shape_plan_t *shape_plan) 171 hb_shape_plan_reference (hb_shape_plan_t *shape_plan)
139 { 172 {
140 return hb_object_reference (shape_plan); 173 return hb_object_reference (shape_plan);
141 } 174 }
142 175
176 /**
177 * hb_shape_plan_destroy: (skip)
178 * @shape_plan: a shape plan.
179 *
180 *
181 *
182 * Since: 1.0
183 **/
143 void 184 void
144 hb_shape_plan_destroy (hb_shape_plan_t *shape_plan) 185 hb_shape_plan_destroy (hb_shape_plan_t *shape_plan)
145 { 186 {
146 if (!hb_object_destroy (shape_plan)) return; 187 if (!hb_object_destroy (shape_plan)) return;
147 188
148 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_DESTROY(shaper, shape_plan); 189 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_DESTROY(shaper, shape_plan);
149 #include "hb-shaper-list.hh" 190 #include "hb-shaper-list.hh"
150 #undef HB_SHAPER_IMPLEMENT 191 #undef HB_SHAPER_IMPLEMENT
151 192
152 hb_face_destroy (shape_plan->face); 193 hb_face_destroy (shape_plan->face);
153 194
154 free (shape_plan); 195 free (shape_plan);
155 } 196 }
156 197
198 /**
199 * hb_shape_plan_set_user_data: (skip)
200 * @shape_plan: a shape plan.
201 * @key:
202 * @data:
203 * @destroy:
204 * @replace:
205 *
206 *
207 *
208 * Return value:
209 *
210 * Since: 1.0
211 **/
157 hb_bool_t 212 hb_bool_t
158 hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan, 213 hb_shape_plan_set_user_data (hb_shape_plan_t *shape_plan,
159 hb_user_data_key_t *key, 214 hb_user_data_key_t *key,
160 void * data, 215 void * data,
161 hb_destroy_func_t destroy, 216 hb_destroy_func_t destroy,
162 hb_bool_t replace) 217 hb_bool_t replace)
163 { 218 {
164 return hb_object_set_user_data (shape_plan, key, data, destroy, replace); 219 return hb_object_set_user_data (shape_plan, key, data, destroy, replace);
165 } 220 }
166 221
222 /**
223 * hb_shape_plan_get_user_data: (skip)
224 * @shape_plan: a shape plan.
225 * @key:
226 *
227 *
228 *
229 * Return value: (transfer none):
230 *
231 * Since: 1.0
232 **/
167 void * 233 void *
168 hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan, 234 hb_shape_plan_get_user_data (hb_shape_plan_t *shape_plan,
169 hb_user_data_key_t *key) 235 hb_user_data_key_t *key)
170 { 236 {
171 return hb_object_get_user_data (shape_plan, key); 237 return hb_object_get_user_data (shape_plan, key);
172 } 238 }
173 239
174 240
241 /**
242 * hb_shape_plan_execute:
243 * @shape_plan: a shape plan.
244 * @font: a font.
245 * @buffer: a buffer.
246 * @features: (array length=num_features):
247 * @num_features:
248 *
249 *
250 *
251 * Return value:
252 *
253 * Since: 1.0
254 **/
175 hb_bool_t 255 hb_bool_t
176 hb_shape_plan_execute (hb_shape_plan_t *shape_plan, 256 hb_shape_plan_execute (hb_shape_plan_t *shape_plan,
177 hb_font_t *font, 257 hb_font_t *font,
178 hb_buffer_t *buffer, 258 hb_buffer_t *buffer,
179 const hb_feature_t *features, 259 const hb_feature_t *features,
180 unsigned int num_features) 260 unsigned int num_features)
181 { 261 {
182 if (unlikely (hb_object_is_inert (shape_plan) || 262 if (unlikely (hb_object_is_inert (shape_plan) ||
183 hb_object_is_inert (font) || 263 hb_object_is_inert (font) ||
184 hb_object_is_inert (buffer))) 264 hb_object_is_inert (buffer)))
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 311
232 static hb_bool_t 312 static hb_bool_t
233 hb_shape_plan_matches (const hb_shape_plan_t *shape_plan, 313 hb_shape_plan_matches (const hb_shape_plan_t *shape_plan,
234 const hb_shape_plan_proposal_t *proposal) 314 const hb_shape_plan_proposal_t *proposal)
235 { 315 {
236 return hb_segment_properties_equal (&shape_plan->props, &proposal->props) && 316 return hb_segment_properties_equal (&shape_plan->props, &proposal->props) &&
237 ((shape_plan->default_shaper_list && proposal->shaper_list == NULL) || 317 ((shape_plan->default_shaper_list && proposal->shaper_list == NULL) ||
238 (shape_plan->shaper_func == proposal->shaper_func)); 318 (shape_plan->shaper_func == proposal->shaper_func));
239 } 319 }
240 320
321 /**
322 * hb_shape_plan_create_cached:
323 * @face:
324 * @props:
325 * @user_features: (array length=num_user_features):
326 * @num_user_features:
327 * @shaper_list: (array zero-terminated=1):
328 *
329 *
330 *
331 * Return value: (transfer full):
332 *
333 * Since: 1.0
334 **/
241 hb_shape_plan_t * 335 hb_shape_plan_t *
242 hb_shape_plan_create_cached (hb_face_t *face, 336 hb_shape_plan_create_cached (hb_face_t *face,
243 const hb_segment_properties_t *props, 337 const hb_segment_properties_t *props,
244 const hb_feature_t *user_features, 338 const hb_feature_t *user_features,
245 unsigned int num_user_features, 339 unsigned int num_user_features,
246 const char * const *shaper_list) 340 const char * const *shaper_list)
247 { 341 {
248 if (num_user_features) 342 if (num_user_features)
249 return hb_shape_plan_create (face, props, user_features, num_user_features, shaper_list); 343 return hb_shape_plan_create (face, props, user_features, num_user_features, shaper_list);
250 344
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 free (node); 394 free (node);
301 goto retry; 395 goto retry;
302 } 396 }
303 397
304 /* Release our reference on face. */ 398 /* Release our reference on face. */
305 hb_face_destroy (face); 399 hb_face_destroy (face);
306 400
307 return hb_shape_plan_reference (shape_plan); 401 return hb_shape_plan_reference (shape_plan);
308 } 402 }
309 403
404 /**
405 * hb_shape_plan_get_shaper:
406 * @shape_plan: a shape plan.
407 *
408 *
409 *
410 * Return value: (transfer none):
411 *
412 * Since: 1.0
413 **/
310 const char * 414 const char *
311 hb_shape_plan_get_shaper (hb_shape_plan_t *shape_plan) 415 hb_shape_plan_get_shaper (hb_shape_plan_t *shape_plan)
312 { 416 {
313 return shape_plan->shaper_name; 417 return shape_plan->shaper_name;
314 } 418 }
OLDNEW
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-shape.cc ('k') | third_party/harfbuzz-ng/src/hb-ucdn.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698