Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
3785393d
by Alexei Podtelezhnikov at 2021-08-26T15:31:11+00:00
1 changed file:
Changes:
... | ... | @@ -380,6 +380,12 @@ typedef ptrdiff_t FT_PtrDist; |
380 | 380 |
/* each slanted line. Nevertheless, these divisions are noticeable */
|
381 | 381 |
/* in the overall performance because flattened curves produce a */
|
382 | 382 |
/* very large number of slanted lines. */
|
383 |
+ /* */
|
|
384 |
+ /* The division results here are always within ONE_PIXEL. Therefore */
|
|
385 |
+ /* the shift magnitude should be at least PIXEL_BITS wider than the */
|
|
386 |
+ /* divisors to provide sufficient accuracy of the multiply-shift. */
|
|
387 |
+ /* It should not exceed (64 - PIXEL_BITS) to prevent overflowing and */
|
|
388 |
+ /* leave enough room for 64-bit unsigned multiplication however. */
|
|
383 | 389 |
#define FT_UDIVPREP( c, b ) \
|
384 | 390 |
FT_Int64 b ## _r = c ? (FT_Int64)( ~(FT_UInt64)0 >> PIXEL_BITS ) / ( b ) \
|
385 | 391 |
: 0
|