OLD | NEW |
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. |
11 * | 11 * |
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR | 12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR |
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES | 13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES |
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN | 14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN |
15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH | 15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
16 * DAMAGE. | 16 * DAMAGE. |
17 * | 17 * |
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, | 18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | 19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND |
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS | 20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO | 21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
23 * | 23 * |
24 * Google Author(s): Behdad Esfahbod | 24 * Google Author(s): Behdad Esfahbod |
25 */ | 25 */ |
26 | 26 |
27 #include "hb-shape-plan-private.hh" | 27 #include "hb-shape-plan-private.hh" |
28 #include "hb-shaper-private.hh" | 28 #include "hb-shaper-private.hh" |
29 #include "hb-font-private.hh" | 29 #include "hb-font-private.hh" |
| 30 #include "hb-buffer-private.hh" |
30 | 31 |
31 #define HB_SHAPER_IMPLEMENT(shaper) \ | 32 #define HB_SHAPER_IMPLEMENT(shaper) \ |
32 HB_SHAPER_DATA_ENSURE_DECLARE(shaper, face) \ | 33 HB_SHAPER_DATA_ENSURE_DECLARE(shaper, face) \ |
33 HB_SHAPER_DATA_ENSURE_DECLARE(shaper, font) | 34 HB_SHAPER_DATA_ENSURE_DECLARE(shaper, font) |
34 #include "hb-shaper-list.hh" | 35 #include "hb-shaper-list.hh" |
35 #undef HB_SHAPER_IMPLEMENT | 36 #undef HB_SHAPER_IMPLEMENT |
36 | 37 |
37 | 38 |
38 static void | 39 static void |
39 hb_shape_plan_plan (hb_shape_plan_t *shape_plan, | 40 hb_shape_plan_plan (hb_shape_plan_t *shape_plan, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 172 } |
172 | 173 |
173 | 174 |
174 hb_bool_t | 175 hb_bool_t |
175 hb_shape_plan_execute (hb_shape_plan_t *shape_plan, | 176 hb_shape_plan_execute (hb_shape_plan_t *shape_plan, |
176 hb_font_t *font, | 177 hb_font_t *font, |
177 hb_buffer_t *buffer, | 178 hb_buffer_t *buffer, |
178 const hb_feature_t *features, | 179 const hb_feature_t *features, |
179 unsigned int num_features) | 180 unsigned int num_features) |
180 { | 181 { |
181 if (unlikely (shape_plan->face != font->face)) | 182 if (unlikely (hb_object_is_inert (shape_plan) || |
| 183 » » hb_object_is_inert (font) || |
| 184 » » hb_object_is_inert (buffer))) |
182 return false; | 185 return false; |
183 | 186 |
| 187 assert (shape_plan->face == font->face); |
| 188 assert (hb_segment_properties_equal (&shape_plan->props, &buffer->props)); |
| 189 |
184 #define HB_SHAPER_EXECUTE(shaper) \ | 190 #define HB_SHAPER_EXECUTE(shaper) \ |
185 HB_STMT_START { \ | 191 HB_STMT_START { \ |
186 return HB_SHAPER_DATA (shaper, shape_plan) && \ | 192 return HB_SHAPER_DATA (shaper, shape_plan) && \ |
187 hb_##shaper##_shaper_font_data_ensure (font) && \ | 193 hb_##shaper##_shaper_font_data_ensure (font) && \ |
188 _hb_##shaper##_shape (shape_plan, font, buffer, features, num_f
eatures); \ | 194 _hb_##shaper##_shape (shape_plan, font, buffer, features, num_f
eatures); \ |
189 } HB_STMT_END | 195 } HB_STMT_END |
190 | 196 |
191 if (0) | 197 if (0) |
192 ; | 198 ; |
193 #define HB_SHAPER_IMPLEMENT(shaper) \ | 199 #define HB_SHAPER_IMPLEMENT(shaper) \ |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 hb_face_destroy (face); | 305 hb_face_destroy (face); |
300 | 306 |
301 return hb_shape_plan_reference (shape_plan); | 307 return hb_shape_plan_reference (shape_plan); |
302 } | 308 } |
303 | 309 |
304 const char * | 310 const char * |
305 hb_shape_plan_get_shaper (hb_shape_plan_t *shape_plan) | 311 hb_shape_plan_get_shaper (hb_shape_plan_t *shape_plan) |
306 { | 312 { |
307 return shape_plan->shaper_name; | 313 return shape_plan->shaper_name; |
308 } | 314 } |
OLD | NEW |