From fd3d32d31cb6d74a9994b6850d539fd0b707d941 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 12 Oct 2010 16:57:47 -0400 Subject: [PATCH] Add hb_ot_shape_execute() Not public yet. --- src/hb-ot-shape-private.hh | 5 ++--- src/hb-ot-shape.cc | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/hb-ot-shape-private.hh b/src/hb-ot-shape-private.hh index aea52af..772b0cd 100644 --- a/src/hb-ot-shape-private.hh +++ b/src/hb-ot-shape-private.hh @@ -38,7 +38,8 @@ HB_BEGIN_DECLS struct hb_ot_shape_context_t { - /* Input to hb_ot_shape() */ + /* Input to hb_ot_shape_execute() */ + hb_ot_shape_plan_t *plan; hb_font_t *font; hb_face_t *face; hb_buffer_t *buffer; @@ -49,8 +50,6 @@ struct hb_ot_shape_context_t hb_direction_t original_direction; hb_bool_t applied_substitute_complex; hb_bool_t applied_position_complex; - - hb_ot_shape_plan_t *plan; }; diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index b6acb22..efa71ba 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -270,7 +270,7 @@ hb_position_complex_fallback_visual (hb_ot_shape_context_t *c) /* Do it! */ static void -hb_ot_shape_internal (hb_ot_shape_context_t *c) +hb_ot_shape_execute_internal (hb_ot_shape_context_t *c) { /* Save the original direction, we use it later. */ c->original_direction = c->buffer->props.direction; @@ -333,6 +333,18 @@ hb_ot_shape_plan_internal (hb_ot_shape_plan_t *plan, } void +hb_ot_shape_execute (hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_face_t *face, + hb_buffer_t *buffer, + const hb_feature_t *user_features, + unsigned int num_user_features) +{ + hb_ot_shape_context_t c = {plan, font, face, buffer, user_features, num_user_features}; + hb_ot_shape_execute_internal (&c); +} + +void hb_ot_shape (hb_font_t *font, hb_face_t *face, hb_buffer_t *buffer, @@ -342,10 +354,7 @@ hb_ot_shape (hb_font_t *font, hb_ot_shape_plan_t plan; hb_ot_shape_plan_internal (&plan, face, &buffer->props, user_features, num_user_features); - - hb_ot_shape_context_t c = {font, face, buffer, user_features, num_user_features}; - c.plan = &plan; - hb_ot_shape_internal (&c); + hb_ot_shape_execute (&plan, font, face, buffer, user_features, num_user_features); } -- 2.7.4