shithub: freetype+ttf2subf

Download patch

ref: f6370e2f0582cf8dd2850756794e9dbbc0f035bc
parent: bc1029b9c5a1eef74037dbe4e5e4598e763d0997
author: Alexei Podtelezhnikov <[email protected]>
date: Fri Jun 25 18:59:39 EDT 2021

[raster] Adjust sub-band bisecting limits.

We can bisect a band until it is just a single scan line.  This might
be slow and cause time-outs but if we need to impose limits it should
be elsewhere.

* src/raster/ftraster.c (Render_Single_Pass): Tweak sub-banding.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2021-06-25  Alexei Podtelezhnikov  <[email protected]>
 
+	[raster] Adjust sub-band bisecting limits.
+
+	We can bisect a band until it is just a single scan line.  This might
+	be slow and cause time-outs but if we need to impose limits it should
+	be elsewhere.
+
+	* src/raster/ftraster.c (Render_Single_Pass): Tweak sub-banding.
+
+2021-06-25  Alexei Podtelezhnikov  <[email protected]>
+
 	* src/raster/ftraster.c (Render_Single_Pass): Remove dead code.
 
 2021-06-25  Werner Lemberg  <[email protected]>
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -528,6 +528,7 @@
     TPoint      arcs[3 * MaxBezier + 1]; /* The Bezier stack               */
 
     black_TBand  band_stack[16];    /* band stack used for sub-banding     */
+                                    /* enough for signed short bands       */
     Int          band_top;          /* band stack top                      */
 
   };
@@ -3054,9 +3055,7 @@
         i = ras.band_stack[ras.band_top].y_min;
         j = ras.band_stack[ras.band_top].y_max;
 
-        k = (Short)( ( i + j ) / 2 );
-
-        if ( ras.band_top >= 7 || k < i )
+        if ( i == j )
         {
           ras.band_top = 0;
 
@@ -3063,10 +3062,12 @@
           return ras.error;  /* still Raster_Overflow */
         }
 
-        ras.band_stack[ras.band_top + 1].y_min = k;
+        k = (Short)( ( i + j ) / 2 );
+
+        ras.band_stack[ras.band_top + 1].y_min = (Short)( k + 1 );
         ras.band_stack[ras.band_top + 1].y_max = j;
 
-        ras.band_stack[ras.band_top].y_max = (Short)( k - 1 );
+        ras.band_stack[ras.band_top].y_max = k;
 
         ras.band_top++;
       }