freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master fcd47b3: * src/smooth/ftgrays.c (gray_sweep): Improve


From: Alexei Podtelezhnikov
Subject: [freetype2] master fcd47b3: * src/smooth/ftgrays.c (gray_sweep): Improve code.
Date: Sun, 12 Feb 2017 23:08:21 -0500 (EST)

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

    * src/smooth/ftgrays.c (gray_sweep): Improve code.
---
 ChangeLog            |  4 ++++
 src/smooth/ftgrays.c | 19 ++++++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 455b5cd..0b71ab5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-02-12  Alexei Podtelezhnikov  <address@hidden>
+
+       * src/smooth/ftgrays.c (gray_sweep): Improve code.
+
 2017-02-06  Werner Lemberg  <address@hidden>
 
        [truetype] Implement `VVAR' table support.
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 349af7f..1fe558d 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -568,9 +568,6 @@ typedef ptrdiff_t  FT_PtrDist;
     /* Note that if a cell is to the left of the clipping region, it is    */
     /* actually set to the (min_ex-1) horizontal position.                 */
 
-    /* All cells that are on the left of the clipping region go to the */
-    /* min_ex - 1 horizontal position.                                 */
-
     if ( ex < ras.min_ex )
       ex = ras.min_ex - 1;
 
@@ -1304,21 +1301,18 @@ typedef ptrdiff_t  FT_PtrDist;
     for ( y = ras.min_ey; y < ras.max_ey; y++ )
     {
       PCell   cell  = ras.ycells[y - ras.min_ey];
-      TCoord  cover = 0;
       TCoord  x     = ras.min_ex;
+      TArea   cover = 0;
+      TArea   area;
 
 
       for ( ; cell != NULL; cell = cell->next )
       {
-        TArea  area;
-
-
         if ( cover != 0 && cell->x > x )
-          gray_hline( RAS_VAR_ x, y, (TArea)cover * ( ONE_PIXEL * 2 ),
-                      cell->x - x );
+          gray_hline( RAS_VAR_ x, y, cover, cell->x - x );
 
-        cover += cell->cover;
-        area   = (TArea)cover * ( ONE_PIXEL * 2 ) - cell->area;
+        cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
+        area   = cover - cell->area;
 
         if ( area != 0 && cell->x >= ras.min_ex )
           gray_hline( RAS_VAR_ cell->x, y, area, 1 );
@@ -1327,8 +1321,7 @@ typedef ptrdiff_t  FT_PtrDist;
       }
 
       if ( cover != 0 )
-        gray_hline( RAS_VAR_ x, y, (TArea)cover * ( ONE_PIXEL * 2 ),
-                    ras.max_ex - x );
+        gray_hline( RAS_VAR_ x, y, cover, ras.max_ex - x );
     }
 
     FT_TRACE7(( "gray_sweep: end\n" ));



reply via email to

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