shithub: freetype+ttf2subf

Download patch

ref: 465ab99585cb748f9de0087d369677cc9e196785
parent: 74916997ded864cb6eb91452c2eaa08f54e5f929
author: Alexei Podtelezhnikov <[email protected]>
date: Wed Oct 29 19:45:23 EDT 2014

[smooth] Improve code readability.

* src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2014-10-29  Alexei Podtelezhnikov  <[email protected]>
 
+	[smooth] Improve code readability.
+
+	* src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.
+
+2014-10-29  Alexei Podtelezhnikov  <[email protected]>
+
 	Unify hypotenuse approximations.
 
 	* include/internal/ftcalc.h (FT_HYPOT): Move macro from here...
--- 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
@@ -260,6 +256,10 @@
       have_buffer = TRUE;
 
     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;