freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master efbae5476: [raster] Eliminate intensive flow checking


From: Werner Lemberg
Subject: [freetype2] master efbae5476: [raster] Eliminate intensive flow checking.
Date: Fri, 24 Nov 2023 10:28:11 -0500 (EST)

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

    [raster] Eliminate intensive flow checking.
    
    * src/raster/ftraster.c (Draw_Sweep): Pass the flow increment.
    (Increment): Accept the flow increment.
---
 src/raster/ftraster.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 1216190ef..7d5e9e59e 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -1913,7 +1913,8 @@
    *   Bubble sort with immediate restart is good enough and simple.
    */
   static void
-  Increment( PProfileList  list )
+  Increment( PProfileList  list,
+             Int           flow )
   {
     PProfile  *old, current, next;
 
@@ -1925,7 +1926,7 @@
       current = *old;
       if ( --current->height )
       {
-        current->offset += ( current->flags & Flow_Up ) ? 1 : -1;
+        current->offset += flow;
         current->X       = current->x[current->offset];
         old = &current->link;
       }
@@ -2267,6 +2268,8 @@
         {
           *Q = P->link;  /* remove */
 
+          /* each active list contains profiles with the same flow */
+          /* left and right are arbitrary, correspond to TrueType  */
           if ( P->flags & Flow_Up )
             InsNew( &draw_left,  P );
           else
@@ -2294,6 +2297,8 @@
           Long  xs;
 
 
+          /* TrueType should have x2 > x1, but can be opposite */
+          /* by mistake or in CFF/Type1, fix it then           */
           if ( x1 > x2 )
           {
             xs = x1;
@@ -2418,8 +2423,8 @@
 
         ras.Proc_Sweep_Step( RAS_VAR );
 
-        Increment( &draw_left  );
-        Increment( &draw_right );
+        Increment( &draw_left,   1 );
+        Increment( &draw_right, -1 );
       }
       while ( ++y < y_turn );
     }



reply via email to

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