From 9ef02bd41a42fb08355c83522331b9d0dab4d685 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Mon, 29 Jun 2015 22:39:10 -0400 Subject: [PATCH] [base] Speed up emboldening. * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use `FT_Vector_NormLen'. --- ChangeLog | 6 ++++++ src/base/ftoutln.c | 14 ++------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index af2586433..8a6882429 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-06-29 Alexei Podtelezhnikov + + [base] Speed up emboldening. + + * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use `FT_Vector_NormLen'. + 2015-06-29 Alexei Podtelezhnikov [base] Implement fast vector normalization. diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c index d821c4957..066eb7e9c 100644 --- a/src/base/ftoutln.c +++ b/src/base/ftoutln.c @@ -946,12 +946,7 @@ /* compute incoming normalized vector */ in.x = v_cur.x - v_prev.x; in.y = v_cur.y - v_prev.y; - l_in = FT_Vector_Length( &in ); - if ( l_in ) - { - in.x = FT_DivFix( in.x, l_in ); - in.y = FT_DivFix( in.y, l_in ); - } + l_in = FT_Vector_NormLen( &in ); for ( n = first; n <= last; n++ ) { @@ -963,12 +958,7 @@ /* compute outgoing normalized vector */ out.x = v_next.x - v_cur.x; out.y = v_next.y - v_cur.y; - l_out = FT_Vector_Length( &out ); - if ( l_out ) - { - out.x = FT_DivFix( out.x, l_out ); - out.y = FT_DivFix( out.y, l_out ); - } + l_out = FT_Vector_NormLen( &out ); d = FT_MulFix( in.x, out.x ) + FT_MulFix( in.y, out.y );