freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] * src/truetype/ttgxvar.c (ft_var_to_nor


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/truetype/ttgxvar.c (ft_var_to_normalized): Edge optimization.
Date: Wed, 10 Nov 2021 13:53:27 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

1 changed file:

Changes:

  • src/truetype/ttgxvar.c
    ... ... @@ -1883,19 +1883,16 @@
    1883 1883
                         " clamping\n",
    
    1884 1884
                         a->minimum / 65536.0,
    
    1885 1885
                         a->maximum / 65536.0 ));
    
    1886
    -
    
    1887
    -        if ( coord > a->maximum )
    
    1888
    -          coord = a->maximum;
    
    1889
    -        else
    
    1890
    -          coord = a->minimum;
    
    1891 1886
           }
    
    1892 1887
     
    
    1893
    -      if ( coord < a->def )
    
    1894
    -        normalized[i] = -FT_DivFix( SUB_LONG( coord, a->def ),
    
    1895
    -                                    SUB_LONG( a->minimum, a->def ) );
    
    1896
    -      else if ( coord > a->def )
    
    1897
    -        normalized[i] = FT_DivFix( SUB_LONG( coord, a->def ),
    
    1888
    +      if ( coord > a->def )
    
    1889
    +        normalized[i] = coord >= a->maximum ?  0x10000L :
    
    1890
    +                        FT_DivFix( SUB_LONG( coord, a->def ),
    
    1898 1891
                                        SUB_LONG( a->maximum, a->def ) );
    
    1892
    +      else if ( coord < a->def )
    
    1893
    +        normalized[i] = coord <= a->minimum ? -0x10000L :
    
    1894
    +                        FT_DivFix( SUB_LONG( coord, a->def ),
    
    1895
    +                                   SUB_LONG( a->def, a->minimum ) );
    
    1899 1896
           else
    
    1900 1897
             normalized[i] = 0;
    
    1901 1898
         }
    


  • reply via email to

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