freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [raster] Improve profile accounting.


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] [raster] Improve profile accounting.
Date: Fri, 13 Oct 2023 15:22:37 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 153c038e
    by Alexei Podtelezhnikov (Алексей Подтележников) at 2023-10-13T15:22:32+00:00
    [raster] Improve profile accounting.
    
    * src/raster/ftraster.c (End_Profile): Do not initiate next profile.
    (New_Profile): Fully initiate new profile.
    (Convert_Glyph): Clean up variables, initialize `fProfile` here.

1 changed file:

Changes:

  • src/raster/ftraster.c
    ... ... @@ -618,9 +618,8 @@
    618 618
       New_Profile( RAS_ARGS TStates  aState,
    
    619 619
                             Bool     overshoot )
    
    620 620
       {
    
    621
    -    if ( !ras.fProfile )
    
    621
    +    if ( !ras.cProfile || ras.cProfile->height )
    
    622 622
         {
    
    623
    -      ras.fProfile  = (PProfile)ras.top;
    
    624 623
           ras.cProfile  = (PProfile)ras.top;
    
    625 624
           ras.top      += AlignProfileSize;
    
    626 625
     
    
    ... ... @@ -717,20 +716,8 @@
    717 716
               ras.cProfile->flags |= Overshoot_Bottom;
    
    718 717
           }
    
    719 718
     
    
    719
    +      /* premature, the last profile in the controur must loop */
    
    720 720
           ras.cProfile->next = (PProfile)ras.top;
    
    721
    -      ras.cProfile       = (PProfile)ras.top;
    
    722
    -
    
    723
    -      ras.top += AlignProfileSize;
    
    724
    -
    
    725
    -      if ( ras.top >= ras.maxBuff )
    
    726
    -      {
    
    727
    -        FT_TRACE1(( "overflow in End_Profile\n" ));
    
    728
    -        ras.error = FT_THROW( Raster_Overflow );
    
    729
    -        return FAILURE;
    
    730
    -      }
    
    731
    -
    
    732
    -      ras.cProfile->offset = ras.top;
    
    733
    -      ras.cProfile->height = 0;
    
    734 721
     
    
    735 722
           ras.num_Profs++;
    
    736 723
         }
    
    ... ... @@ -1971,6 +1958,7 @@
    1971 1958
     
    
    1972 1959
     
    
    1973 1960
         ras.fProfile = NULL;
    
    1961
    +    ras.cProfile = NULL;
    
    1974 1962
         ras.joint    = FALSE;
    
    1975 1963
         ras.fresh    = FALSE;
    
    1976 1964
     
    
    ... ... @@ -1983,7 +1971,6 @@
    1983 1971
         last = -1;
    
    1984 1972
         for ( i = 0; i < ras.outline.n_contours; i++ )
    
    1985 1973
         {
    
    1986
    -      PProfile  lastProfile;
    
    1987 1974
           Bool      o;
    
    1988 1975
     
    
    1989 1976
     
    
    ... ... @@ -2009,7 +1996,6 @@
    2009 1996
                    ( ras.cProfile->flags & Flow_Up ) )
    
    2010 1997
               ras.top--;
    
    2011 1998
     
    
    2012
    -      lastProfile = ras.cProfile;
    
    2013 1999
           if ( ras.top != ras.cProfile->offset &&
    
    2014 2000
                ( ras.cProfile->flags & Flow_Up ) )
    
    2015 2001
             o = IS_TOP_OVERSHOOT( ras.lastY );
    
    ... ... @@ -2018,8 +2004,11 @@
    2018 2004
           if ( End_Profile( RAS_VARS o ) )
    
    2019 2005
             return FAILURE;
    
    2020 2006
     
    
    2021
    -      /* close the `next profile in contour' linked list */
    
    2022
    -      lastProfile->next = ras.gProfile;
    
    2007
    +      /* loop the last profile in the contour */
    
    2008
    +      ras.cProfile->next = ras.gProfile;
    
    2009
    +
    
    2010
    +      if ( !ras.fProfile )
    
    2011
    +        ras.fProfile = ras.gProfile;
    
    2023 2012
         }
    
    2024 2013
     
    
    2025 2014
         if ( Finalize_Profile_Table( RAS_VAR ) )
    


  • reply via email to

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