freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] * src/smooth/ftgrays.c (gray_render_con


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/smooth/ftgrays.c (gray_render_conic): Refactor redundancy.
Date: Tue, 24 Aug 2021 19:32:58 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

1 changed file:

Changes:

  • src/smooth/ftgrays.c
    ... ... @@ -1023,10 +1023,9 @@ typedef ptrdiff_t FT_PtrDist;
    1023 1023
                                   const FT_Vector*  to )
    
    1024 1024
       {
    
    1025 1025
         FT_Vector  p0, p1, p2;
    
    1026
    -    TPos       dx, dy;
    
    1026
    +    TPos       ax, ay, bx, by, dx, dy;
    
    1027 1027
         int        shift;
    
    1028 1028
     
    
    1029
    -    FT_Int64  ax, ay, bx, by;
    
    1030 1029
         FT_Int64  rx, ry;
    
    1031 1030
         FT_Int64  qx, qy;
    
    1032 1031
         FT_Int64  px, py;
    
    ... ... @@ -1054,8 +1053,13 @@ typedef ptrdiff_t FT_PtrDist;
    1054 1053
           return;
    
    1055 1054
         }
    
    1056 1055
     
    
    1057
    -    dx = FT_ABS( p0.x + p2.x - 2 * p1.x );
    
    1058
    -    dy = FT_ABS( p0.y + p2.y - 2 * p1.y );
    
    1056
    +    bx = p1.x - p0.x;
    
    1057
    +    by = p1.y - p0.y;
    
    1058
    +    ax = p2.x - p1.x - bx;  /* p0.x + p2.x - 2 * p1.x */
    
    1059
    +    ay = p2.y - p1.y - by;  /* p0.y + p2.y - 2 * p1.y */
    
    1060
    +
    
    1061
    +    dx = FT_ABS( ax );
    
    1062
    +    dy = FT_ABS( ay );
    
    1059 1063
         if ( dx < dy )
    
    1060 1064
           dx = dy;
    
    1061 1065
     
    
    ... ... @@ -1144,10 +1148,10 @@ typedef ptrdiff_t FT_PtrDist;
    1144 1148
           __m128i  p;
    
    1145 1149
     
    
    1146 1150
     
    
    1147
    -      u.i.ax = p0.x + p2.x - 2 * p1.x;
    
    1148
    -      u.i.ay = p0.y + p2.y - 2 * p1.y;
    
    1149
    -      u.i.bx = p1.x - p0.x;
    
    1150
    -      u.i.by = p1.y - p0.y;
    
    1151
    +      u.i.ax = ax;
    
    1152
    +      u.i.ay = ay;
    
    1153
    +      u.i.bx = bx;
    
    1154
    +      u.i.by = by;
    
    1151 1155
     
    
    1152 1156
           a = _mm_load_si128( &u.vec.a );
    
    1153 1157
           b = _mm_load_si128( &u.vec.b );
    
    ... ... @@ -1165,7 +1169,7 @@ typedef ptrdiff_t FT_PtrDist;
    1165 1169
     
    
    1166 1170
           p = _mm_load_si128( &v.vec );
    
    1167 1171
     
    
    1168
    -      for ( count = ( 1U << shift ); count > 0; count-- )
    
    1172
    +      for ( count = 1U << shift; count > 0; count-- )
    
    1169 1173
           {
    
    1170 1174
             p = _mm_add_epi64( p, q );
    
    1171 1175
             q = _mm_add_epi64( q, r );
    
    ... ... @@ -1179,11 +1183,6 @@ typedef ptrdiff_t FT_PtrDist;
    1179 1183
         }
    
    1180 1184
     #endif  /* __SSE2__ */
    
    1181 1185
     
    
    1182
    -    ax = p0.x + p2.x - 2 * p1.x;
    
    1183
    -    ay = p0.y + p2.y - 2 * p1.y;
    
    1184
    -    bx = p1.x - p0.x;
    
    1185
    -    by = p1.y - p0.y;
    
    1186
    -
    
    1187 1186
         rx = LEFT_SHIFT( ax, 33 - 2 * shift );
    
    1188 1187
         ry = LEFT_SHIFT( ay, 33 - 2 * shift );
    
    1189 1188
     
    


  • reply via email to

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