freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 5a6dc87: [raster,smooth] Microoptimizations.


From: Alexei Podtelezhnikov
Subject: [freetype2] master 5a6dc87: [raster,smooth] Microoptimizations.
Date: Sat, 05 Sep 2015 03:15:43 +0000

branch: master
commit 5a6dc87240905f0e55568678e0fbf93a51242051
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>

    [raster,smooth] Microoptimizations.
    
    * src/raster/ftraster.c (Insert_Y_Turn, Finalize_Profile_Table,
    Beziier_Up, ): Use do-while loops.
    
    * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line,
    gray_convert_glyph): Ditto.
---
 ChangeLog             |   10 ++++++++++
 src/raster/ftraster.c |   14 ++++++--------
 src/smooth/ftgrays.c  |   12 ++++++------
 3 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 977473a..a6e6db3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-09-04  Alexei Podtelezhnikov  <address@hidden>
+
+       [raster,smooth] Microoptimizations.
+
+       * src/raster/ftraster.c (Insert_Y_Turn, Finalize_Profile_Table,
+       Beziier_Up, ): Use do-while loops.
+
+       * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line,
+       gray_convert_glyph): Ditto.
+
 2015-09-04  Werner Lemberg  <address@hidden>
 
        [autofit] Redesign code ranges (2/2).
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 8e9c794..1c51f91 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -801,15 +801,14 @@
 
     /* if it is <, simply insert it, ignore if == */
     if ( n >= 0 && y > y_turns[n] )
-      while ( n >= 0 )
+      do
       {
         Int  y2 = (Int)y_turns[n];
 
 
         y_turns[n] = y;
         y = y2;
-        n--;
-      }
+      } while ( --n >= 0 );
 
     if ( n < 0 )
     {
@@ -850,7 +849,7 @@
 
     if ( n > 1 && p )
     {
-      while ( n > 0 )
+      do
       {
         Int  bottom, top;
 
@@ -878,8 +877,7 @@
           return FAILURE;
 
         p = p->link;
-        n--;
-      }
+      } while ( --n );
     }
     else
       ras.fProfile = NULL;
@@ -1250,7 +1248,7 @@
 
     start_arc = arc;
 
-    while ( arc >= start_arc && e <= e2 )
+    do
     {
       ras.joint = FALSE;
 
@@ -1283,7 +1281,7 @@
         }
         arc -= degree;
       }
-    }
+    } while ( arc >= start_arc && e <= e2 );
 
   Fin:
     ras.top  = top;
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index a9317e9..e4559b9 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -758,7 +758,7 @@ typedef ptrdiff_t  FT_PtrDist;
 
       mod -= (int)dx;
 
-      while ( ex1 != ex2 )
+      do
       {
         delta = lift;
         mod  += rem;
@@ -773,7 +773,7 @@ typedef ptrdiff_t  FT_PtrDist;
         y1        += delta;
         ex1       += incr;
         gray_set_cell( RAS_VAR_ ex1, ey );
-      }
+      } while ( ex1 != ex2 );
     }
 
     delta      = y2 - y1;
@@ -896,7 +896,7 @@ typedef ptrdiff_t  FT_PtrDist;
       FT_DIV_MOD( int, p, dy, lift, rem );
       mod -= (int)dy;
 
-      while ( ey1 != ey2 )
+      do
       {
         delta = lift;
         mod  += rem;
@@ -914,7 +914,7 @@ typedef ptrdiff_t  FT_PtrDist;
 
         ey1 += incr;
         gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 );
-      }
+      } while ( ey1 != ey2 );
     }
 
     gray_render_scanline( RAS_VAR_ ey1, x,
@@ -1847,7 +1847,7 @@ typedef ptrdiff_t  FT_PtrDist;
       bands[0].max = max;
       band         = bands;
 
-      while ( band >= bands )
+      do
       {
         TPos  bottom, top, middle;
         int   error;
@@ -1923,7 +1923,7 @@ typedef ptrdiff_t  FT_PtrDist;
         band[0].min = middle;
         band[0].max = top;
         band++;
-      }
+      } while ( band >= bands );
     }
 
     if ( ras.band_shoot > 8 && ras.band_size > 16 )



reply via email to

[Prev in Thread] Current Thread [Next in Thread]