[base] Optimize `FT_Angle_Diff'.
Under normal circumstances we are usually close to the desired range of angle values, so that the remainder is not really necessary. * src/base/fttrigon.c (FT_Angle_Diff): Use loops instead of remainder. * src/autofit/aftypes.h (AF_ANGLE_DIFF): Ditto in the unused macro.
This commit is contained in:
parent
6cc425db91
commit
dac5644cea
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2015-03-21 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||||
|
|
||||||
|
[base] Optimize `FT_Angle_Diff'.
|
||||||
|
|
||||||
|
Under normal circumstances we are usually close to the desired range
|
||||||
|
of angle values, so that the remainder is not really necessary.
|
||||||
|
|
||||||
|
* src/base/fttrigon.c (FT_Angle_Diff): Use loops instead of remainder.
|
||||||
|
|
||||||
|
* src/autofit/aftypes.h (AF_ANGLE_DIFF): Ditto in the unused macro.
|
||||||
|
|
||||||
2015-03-21 Werner Lemberg <wl@gnu.org>
|
2015-03-21 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[truetype] Improve `gvar' handling.
|
[truetype] Improve `gvar' handling.
|
||||||
|
|
|
@ -138,11 +138,10 @@ extern void* _af_debug_hints;
|
||||||
AF_Angle _delta = (angle2) - (angle1); \
|
AF_Angle _delta = (angle2) - (angle1); \
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
_delta %= AF_ANGLE_2PI; \
|
while ( _delta <= -AF_ANGLE_PI ) \
|
||||||
if ( _delta < 0 ) \
|
|
||||||
_delta += AF_ANGLE_2PI; \
|
_delta += AF_ANGLE_2PI; \
|
||||||
\
|
\
|
||||||
if ( _delta > AF_ANGLE_PI ) \
|
while ( _delta > AF_ANGLE_PI ) \
|
||||||
_delta -= AF_ANGLE_2PI; \
|
_delta -= AF_ANGLE_2PI; \
|
||||||
\
|
\
|
||||||
result = _delta; \
|
result = _delta; \
|
||||||
|
|
|
@ -512,11 +512,10 @@
|
||||||
FT_Angle delta = angle2 - angle1;
|
FT_Angle delta = angle2 - angle1;
|
||||||
|
|
||||||
|
|
||||||
delta %= FT_ANGLE_2PI;
|
while ( delta <= -FT_ANGLE_PI )
|
||||||
if ( delta < 0 )
|
|
||||||
delta += FT_ANGLE_2PI;
|
delta += FT_ANGLE_2PI;
|
||||||
|
|
||||||
if ( delta > FT_ANGLE_PI )
|
while ( delta > FT_ANGLE_PI )
|
||||||
delta -= FT_ANGLE_2PI;
|
delta -= FT_ANGLE_2PI;
|
||||||
|
|
||||||
return delta;
|
return delta;
|
||||||
|
|
Loading…
Reference in New Issue