freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master d1e894b1f: [raster] Clean up sweeping.


From: Werner Lemberg
Subject: [freetype2] master d1e894b1f: [raster] Clean up sweeping.
Date: Sun, 22 Oct 2023 13:12:34 -0400 (EDT)

branch: master
commit d1e894b1f18abb86779b059257c338006621f864
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    [raster] Clean up sweeping.
    
    * src/raster/ftraster.c (Draw_Sweep): Zero initialize the working
    lists directly and remove unnecessary y-turn checks.
    (Init_Linked): Removed.
---
 src/raster/ftraster.c | 38 +++++++-------------------------------
 1 file changed, 7 insertions(+), 31 deletions(-)

diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 1db45db38..0c6acd20e 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -2005,19 +2005,6 @@
   /*************************************************************************/
 
 
-  /**************************************************************************
-   *
-   * Init_Linked
-   *
-   *   Initializes an empty linked list.
-   */
-  static void
-  Init_Linked( TProfileList*  l )
-  {
-    *l = NULL;
-  }
-
-
   /**************************************************************************
    *
    * InsNew
@@ -2625,6 +2612,9 @@
    *
    * Generic Sweep Drawing routine
    *
+   * Note that this routine is executed with the pool containing at least
+   * two valid profiles (up and down) and two y-turns (top and bottom).
+   *
    */
 
   static Bool
@@ -2638,16 +2628,10 @@
 
     Long          x1, x2, xs, e1, e2;
 
-    TProfileList  waiting;
-    TProfileList  draw_left, draw_right;
-
-
-    /* initialize empty linked lists */
+    TProfileList  waiting    = NULL;
+    TProfileList  draw_left  = NULL;
+    TProfileList  draw_right = NULL;
 
-    Init_Linked( &waiting );
-
-    Init_Linked( &draw_left  );
-    Init_Linked( &draw_right );
 
     /* first, compute min and max Y */
 
@@ -2673,13 +2657,6 @@
       P = Q;
     }
 
-    /* check the Y-turns */
-    if ( ras.numTurns == 0 )
-    {
-      ras.error = FT_THROW( Invalid_Outline );
-      return FAILURE;
-    }
-
     /* now initialize the sweep */
 
     ras.Proc_Sweep_Init( RAS_VARS min_Y, max_Y );
@@ -2699,8 +2676,7 @@
     y        = min_Y;
     y_height = 0;
 
-    if ( ras.numTurns > 0                     &&
-         ras.sizeBuff[-ras.numTurns] == min_Y )
+    if ( ras.sizeBuff[-ras.numTurns] == min_Y )
       ras.numTurns--;
 
     while ( ras.numTurns > 0 )



reply via email to

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