freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [raster] Small optimizations.


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] [raster] Small optimizations.
Date: Thu, 19 Oct 2023 03:21:51 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 4e61303a
    by Alexei Podtelezhnikov (Алексей Подтележников) at 2023-10-18T23:13:13-04:00
    [raster] Small optimizations.
    
    * src/raster/ftraster.c (New_Profile): Set important fields only and
    delay setting `gProfile` until...
    (End_Profile): ... it is checked to be valid here.
    (Convert_Glyph): Updated.
    

1 changed file:

Changes:

  • src/raster/ftraster.c
    ... ... @@ -682,13 +682,11 @@
    682 682
             ras.error = FT_THROW( Raster_Overflow );
    
    683 683
             return FAILURE;
    
    684 684
           }
    
    685
    +
    
    686
    +      ras.cProfile->height = 0;
    
    687
    +      ras.cProfile->offset = ras.top;
    
    685 688
         }
    
    686 689
     
    
    687
    -    ras.cProfile->start  = 0;
    
    688
    -    ras.cProfile->height = 0;
    
    689
    -    ras.cProfile->offset = ras.top;
    
    690
    -    ras.cProfile->link   = NULL;
    
    691
    -    ras.cProfile->next   = NULL;
    
    692 690
         ras.cProfile->flags  = ras.dropOutControl;
    
    693 691
     
    
    694 692
         switch ( aState )
    
    ... ... @@ -713,9 +711,6 @@
    713 711
           return FAILURE;
    
    714 712
         }
    
    715 713
     
    
    716
    -    if ( !ras.gProfile )
    
    717
    -      ras.gProfile = ras.cProfile;
    
    718
    -
    
    719 714
         ras.state = aState;
    
    720 715
         ras.fresh = TRUE;
    
    721 716
         ras.joint = FALSE;
    
    ... ... @@ -730,7 +725,7 @@
    730 725
        *   End_Profile
    
    731 726
        *
    
    732 727
        * @Description:
    
    733
    -   *   Finalize the current profile.
    
    728
    +   *   Finalize the current profile and record y-turns.
    
    734 729
        *
    
    735 730
        * @Input:
    
    736 731
        *   overshoot ::
    
    ... ... @@ -787,9 +782,12 @@
    787 782
                Insert_Y_Turn( RAS_VARS top + 1 ) )
    
    788 783
             return FAILURE;
    
    789 784
     
    
    785
    +      if ( !ras.gProfile )
    
    786
    +        ras.gProfile = p;
    
    787
    +
    
    790 788
           /* preliminary values to be finalized */
    
    791
    -      p->link = (PProfile)ras.top;
    
    792 789
           p->next = ras.gProfile;
    
    790
    +      p->link = (PProfile)ras.top;
    
    793 791
     
    
    794 792
           ras.num_Profs++;
    
    795 793
         }
    
    ... ... @@ -816,6 +814,7 @@
    816 814
         PProfile  q;
    
    817 815
     
    
    818 816
     
    
    817
    +    /* there should be at least two profiles, up and down */
    
    819 818
         while ( --n )
    
    820 819
         {
    
    821 820
           q = p->link;
    
    ... ... @@ -1990,11 +1989,11 @@
    1990 1989
           if ( End_Profile( RAS_VARS o ) )
    
    1991 1990
             return FAILURE;
    
    1992 1991
     
    
    1993
    -      if ( !ras.fProfile && ras.num_Profs )
    
    1992
    +      if ( !ras.fProfile )
    
    1994 1993
             ras.fProfile = ras.gProfile;
    
    1995 1994
         }
    
    1996 1995
     
    
    1997
    -    if ( ras.num_Profs )
    
    1996
    +    if ( ras.fProfile )
    
    1998 1997
           Finalize_Profile_Table( RAS_VAR );
    
    1999 1998
     
    
    2000 1999
         return SUCCESS;
    


  • reply via email to

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