From efbae5476f50c549004cbcf70edcf4dc8179cbf6 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Fri, 24 Nov 2023 10:23:36 -0500 Subject: [PATCH] [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 = ¤t->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 ); }