Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
686e2a5e
by Alexei Podtelezhnikov at 2021-08-25T23:18:43+00:00
1 changed file:
Changes:
... | ... | @@ -373,8 +373,13 @@ typedef ptrdiff_t FT_PtrDist; |
373 | 373 |
#endif /* __arm__ */
|
374 | 374 |
|
375 | 375 |
|
376 |
- /* These macros speed up repetitive divisions by replacing them */
|
|
377 |
- /* with multiplications and right shifts. */
|
|
376 |
+ /* Calculating coverages for a slanted line requires a division each */
|
|
377 |
+ /* time the line crosses from cell to cell. These macros speed up */
|
|
378 |
+ /* the repetitive divisions by replacing them with multiplications */
|
|
379 |
+ /* and right shifts so that at most two divisions are performed for */
|
|
380 |
+ /* each slanted line. Nevertheless, these divisions are noticeable */
|
|
381 |
+ /* in the overall performance because flattened curves produce a */
|
|
382 |
+ /* very large number of slanted lines. */
|
|
378 | 383 |
#define FT_UDIVPREP( c, b ) \
|
379 | 384 |
FT_Int64 b ## _r = c ? (FT_Int64)( ~(FT_UInt64)0 >> PIXEL_BITS ) / ( b ) \
|
380 | 385 |
: 0
|