diff --git a/src/hb-draw.cc b/src/hb-draw.cc index d64b328b4..396d0b33e 100644 --- a/src/hb-draw.cc +++ b/src/hb-draw.cc @@ -41,11 +41,19 @@ hb_draw_line_to_nil (hb_draw_funcs_t *dfuncs HB_UNUSED, void *draw_data HB_UNUSE void *user_data HB_UNUSED) {} static void -hb_draw_quadratic_to_nil (hb_draw_funcs_t *dfuncs HB_UNUSED, void *draw_data HB_UNUSED, - hb_draw_state_t *st HB_UNUSED, - float control_x HB_UNUSED, float control_y HB_UNUSED, - float to_x HB_UNUSED, float to_y HB_UNUSED, - void *user_data HB_UNUSED) {} +hb_draw_quadratic_to_nil (hb_draw_funcs_t *dfuncs, void *draw_data, + hb_draw_state_t *st, + float control_x, float control_y, + float to_x, float to_y, + void *user_data) +{ + dfuncs->emit_cubic_to (draw_data, *st, + (st->current_x + 2.f * control_x) / 3.f, + (st->current_y + 2.f * control_y) / 3.f, + (to_x + 2.f * control_x) / 3.f, + (to_y + 2.f * control_y) / 3.f, + to_x, to_y); +} static void hb_draw_cubic_to_nil (hb_draw_funcs_t *dfuncs HB_UNUSED, void *draw_data HB_UNUSED, @@ -174,10 +182,6 @@ DEFINE_NULL_INSTANCE (hb_draw_funcs_t) = } }; -/* XXX Remove. */ - -bool -hb_draw_funcs_t::quadratic_to_is_set () { return func.quadratic_to != hb_draw_quadratic_to_nil; } /** * hb_draw_funcs_reference: diff --git a/src/hb-draw.hh b/src/hb-draw.hh index e922434be..873e2ec01 100644 --- a/src/hb-draw.hh +++ b/src/hb-draw.hh @@ -92,8 +92,6 @@ struct hb_draw_funcs_t { func.close_path (this, draw_data, &st, user_data.close_path); } - /* XXX Remove */ - HB_INTERNAL bool quadratic_to_is_set (); void move_to (void *draw_data, hb_draw_state_t &st, float to_x, float to_y) @@ -118,15 +116,7 @@ struct hb_draw_funcs_t float to_x, float to_y) { if (!st.path_open) start_path (draw_data, st); - if (quadratic_to_is_set ()) - emit_quadratic_to (draw_data, st, control_x, control_y, to_x, to_y); - else - emit_cubic_to (draw_data, st, - (st.current_x + 2.f * control_x) / 3.f, - (st.current_y + 2.f * control_y) / 3.f, - (to_x + 2.f * control_x) / 3.f, - (to_y + 2.f * control_y) / 3.f, - to_x, to_y); + emit_quadratic_to (draw_data, st, control_x, control_y, to_x, to_y); st.current_x = to_x; st.current_y = to_y; }