freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master b3a6a20a8 3/3: [smooth] Switch to vertical bisections


From: Werner Lemberg
Subject: [freetype2] master b3a6a20a8 3/3: [smooth] Switch to vertical bisections.
Date: Sun, 14 Apr 2024 15:51:32 -0400 (EDT)

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

    [smooth] Switch to vertical bisections.
    
    With horizontal bisections, the smallest section is a whole single
    scanline. Almost horizontal lines or other complex scanlines can
    easily overflow the rendering pool. Switching to vertical bisections
    splits the scanlines and should rule out the overflows.  Fixes #1269.
    
    * src/smooth/ftgrays.c (gray_convert_glyph): Bisect vertically.
---
 src/smooth/ftgrays.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 3345e7991..f011e9f8d 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1892,18 +1892,17 @@ typedef ptrdiff_t  FT_PtrDist;
       height  = ( height + n - 1 ) / n;
     }
 
-    ras.min_ex = ras.cbox.xMin;
-    ras.max_ex = ras.cbox.xMax;
-
     for ( y = ras.cbox.yMin; y < ras.cbox.yMax; )
     {
       ras.min_ey = y;
       y         += height;
       ras.max_ey = FT_MIN( y, ras.cbox.yMax );
 
+      ras.count_ey = ras.max_ey - ras.min_ey;
+
       band    = bands;
-      band[1] = ras.min_ey;
-      band[0] = ras.max_ey;
+      band[1] = ras.cbox.xMin;
+      band[0] = ras.cbox.xMax;
 
       do
       {
@@ -1911,10 +1910,8 @@ typedef ptrdiff_t  FT_PtrDist;
         int     error;
 
 
-        ras.min_ey   = band[1];
-        ras.max_ey   = band[0];
-
-        ras.count_ey = ras.max_ey - ras.min_ey;
+        ras.min_ex = band[1];
+        ras.max_ex = band[0];
 
         /* memory management: zero out and skip ycells */
         for ( i = 0; i < ras.count_ey; ++i )



reply via email to

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