[smooth] Improve code readability. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
diff --git a/ChangeLog b/ChangeLog
index 78dd95e..4a09f59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2014-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
+ [smooth] Improve code readability.
+
+ * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.
+
+2014-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
+
Unify hypotenuse approximations.
* include/internal/ftcalc.h (FT_HYPOT): Move macro from here...
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 89088cd..fce42cf 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;