freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 3785393: Expand comment (cont'd).


From: Werner Lemberg
Subject: [freetype2] master 3785393: Expand comment (cont'd).
Date: Thu, 26 Aug 2021 11:31:16 -0400 (EDT)

branch: master
commit 3785393d1a3c12fb1b4a3995cc0e953a58531cfe
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    Expand comment (cont'd).
---
 src/smooth/ftgrays.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 5ae7918..c550c33 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -380,6 +380,12 @@ typedef ptrdiff_t  FT_PtrDist;
   /* each slanted line.  Nevertheless, these divisions are noticeable  */
   /* in the overall performance because flattened curves produce a     */
   /* very large number of slanted lines.                               */
+  /*                                                                   */
+  /* The division results here are always within ONE_PIXEL.  Therefore */
+  /* the shift magnitude should be at least PIXEL_BITS wider than the  */
+  /* divisors to provide sufficient accuracy of the multiply-shift.    */
+  /* It should not exceed (64 - PIXEL_BITS) to prevent overflowing and */
+  /* leave enough room for 64-bit unsigned multiplication however.     */
 #define FT_UDIVPREP( c, b )                                                 \
   FT_Int64  b ## _r = c ? (FT_Int64)( ~(FT_UInt64)0 >> PIXEL_BITS ) / ( b ) \
                     : 0



reply via email to

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