[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.
This commit is contained in:
Alexei Podtelezhnikov 2024-04-14 15:37:57 -04:00
parent fff58f5424
commit b3a6a20a80
1 changed files with 6 additions and 9 deletions

View File

@ -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 )