From 465ab99585cb748f9de0087d369677cc9e196785 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Wed, 29 Oct 2014 23:45:23 -0400 Subject: [PATCH] [smooth] Improve code readability. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code. --- ChangeLog | 6 ++++++ src/smooth/ftsmooth.c | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78dd95e71..4a09f59ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-10-29 Alexei Podtelezhnikov + + [smooth] Improve code readability. + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code. + 2014-10-29 Alexei Podtelezhnikov Unify hypotenuse approximations. diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c index 89088cd09..fce42cfeb 100644 --- a/src/smooth/ftsmooth.c +++ b/src/smooth/ftsmooth.c @@ -182,14 +182,6 @@ height_org = height; #endif - /* release old bitmap buffer */ - if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) - { - FT_FREE( bitmap->buffer ); - slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP; - } - - /* allocate new one */ pitch = width; if ( hmul ) { @@ -250,10 +242,14 @@ bitmap->rows = height; bitmap->pitch = pitch; - /* translate outline to render it into the bitmap */ - FT_Outline_Translate( outline, -x_shift, -y_shift ); - have_outline_shifted = TRUE; + /* release old bitmap buffer */ + if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) + { + FT_FREE( bitmap->buffer ); + slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP; + } + /* allocate new one */ if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) ) goto Exit; else @@ -261,6 +257,10 @@ slot->internal->flags |= FT_GLYPH_OWN_BITMAP; + /* translate outline to render it into the bitmap */ + FT_Outline_Translate( outline, -x_shift, -y_shift ); + have_outline_shifted = TRUE; + /* set up parameters */ params.target = bitmap; params.source = outline;