| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 1998-2004 David Turner and Werner Lemberg | 2 * Copyright © 1998-2004 David Turner and Werner Lemberg |
| 3 * Copyright © 2004,2007,2009,2010 Red Hat, Inc. | 3 * Copyright © 2004,2007,2009,2010 Red Hat, Inc. |
| 4 * Copyright © 2011,2012 Google, Inc. | 4 * Copyright © 2011,2012 Google, Inc. |
| 5 * | 5 * |
| 6 * This is part of HarfBuzz, a text shaping library. | 6 * This is part of HarfBuzz, a text shaping library. |
| 7 * | 7 * |
| 8 * Permission is hereby granted, without written agreement and without | 8 * Permission is hereby granted, without written agreement and without |
| 9 * license or royalty fees, to use, copy, modify, and distribute this | 9 * license or royalty fees, to use, copy, modify, and distribute this |
| 10 * software and its documentation for any purpose, provided that the | 10 * software and its documentation for any purpose, provided that the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 24 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 25 * | 25 * |
| 26 * Red Hat Author(s): Owen Taylor, Behdad Esfahbod | 26 * Red Hat Author(s): Owen Taylor, Behdad Esfahbod |
| 27 * Google Author(s): Behdad Esfahbod | 27 * Google Author(s): Behdad Esfahbod |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #ifndef HB_BUFFER_PRIVATE_HH | 30 #ifndef HB_BUFFER_PRIVATE_HH |
| 31 #define HB_BUFFER_PRIVATE_HH | 31 #define HB_BUFFER_PRIVATE_HH |
| 32 | 32 |
| 33 #include "hb-private.hh" | 33 #include "hb-private.hh" |
| 34 #include "hb-buffer.h" | |
| 35 #include "hb-object-private.hh" | 34 #include "hb-object-private.hh" |
| 36 #include "hb-unicode-private.hh" | 35 #include "hb-unicode-private.hh" |
| 37 | 36 |
| 38 | 37 |
| 39 ASSERT_STATIC (sizeof (hb_glyph_info_t) == 20); | 38 ASSERT_STATIC (sizeof (hb_glyph_info_t) == 20); |
| 40 ASSERT_STATIC (sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t)); | 39 ASSERT_STATIC (sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t)); |
| 41 | 40 |
| 42 | 41 |
| 43 /* | 42 /* |
| 44 * hb_buffer_t | 43 * hb_buffer_t |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 173 |
| 175 HB_INTERNAL void merge_clusters (unsigned int start, | 174 HB_INTERNAL void merge_clusters (unsigned int start, |
| 176 unsigned int end); | 175 unsigned int end); |
| 177 HB_INTERNAL void merge_out_clusters (unsigned int start, | 176 HB_INTERNAL void merge_out_clusters (unsigned int start, |
| 178 unsigned int end); | 177 unsigned int end); |
| 179 | 178 |
| 180 /* Internal methods */ | 179 /* Internal methods */ |
| 181 HB_INTERNAL bool enlarge (unsigned int size); | 180 HB_INTERNAL bool enlarge (unsigned int size); |
| 182 | 181 |
| 183 inline bool ensure (unsigned int size) | 182 inline bool ensure (unsigned int size) |
| 184 { return likely (size < allocated) ? true : enlarge (size); } | 183 { return likely (!size || size < allocated) ? true : enlarge (size); } |
| 185 | 184 |
| 186 HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out); | 185 HB_INTERNAL bool make_room_for (unsigned int num_in, unsigned int num_out); |
| 187 HB_INTERNAL bool shift_forward (unsigned int count); | 186 HB_INTERNAL bool shift_forward (unsigned int count); |
| 188 | 187 |
| 189 typedef long scratch_buffer_t; | 188 typedef long scratch_buffer_t; |
| 190 HB_INTERNAL scratch_buffer_t *get_scratch_buffer (unsigned int *size); | 189 HB_INTERNAL scratch_buffer_t *get_scratch_buffer (unsigned int *size); |
| 191 | 190 |
| 192 inline void clear_context (unsigned int side) { context_len[side] = 0; } | 191 inline void clear_context (unsigned int side) { context_len[side] = 0; } |
| 193 }; | 192 }; |
| 194 | 193 |
| 195 | 194 |
| 196 #define HB_BUFFER_XALLOCATE_VAR(b, func, var, owner) \ | 195 #define HB_BUFFER_XALLOCATE_VAR(b, func, var, owner) \ |
| 197 b->func (offsetof (hb_glyph_info_t, var) - offsetof(hb_glyph_info_t, var1), \ | 196 b->func (offsetof (hb_glyph_info_t, var) - offsetof(hb_glyph_info_t, var1), \ |
| 198 sizeof (b->info[0].var), owner) | 197 sizeof (b->info[0].var), owner) |
| 199 #define HB_BUFFER_ALLOCATE_VAR(b, var) \ | 198 #define HB_BUFFER_ALLOCATE_VAR(b, var) \ |
| 200 HB_BUFFER_XALLOCATE_VAR (b, allocate_var, var (), #var) | 199 HB_BUFFER_XALLOCATE_VAR (b, allocate_var, var (), #var) |
| 201 #define HB_BUFFER_DEALLOCATE_VAR(b, var) \ | 200 #define HB_BUFFER_DEALLOCATE_VAR(b, var) \ |
| 202 HB_BUFFER_XALLOCATE_VAR (b, deallocate_var, var (), #var) | 201 HB_BUFFER_XALLOCATE_VAR (b, deallocate_var, var (), #var) |
| 203 #define HB_BUFFER_ASSERT_VAR(b, var) \ | 202 #define HB_BUFFER_ASSERT_VAR(b, var) \ |
| 204 HB_BUFFER_XALLOCATE_VAR (b, assert_var, var (), #var) | 203 HB_BUFFER_XALLOCATE_VAR (b, assert_var, var (), #var) |
| 205 | 204 |
| 206 | 205 |
| 207 #endif /* HB_BUFFER_PRIVATE_HH */ | 206 #endif /* HB_BUFFER_PRIVATE_HH */ |
| OLD | NEW |