[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.
This commit is contained in:
Alexei Podtelezhnikov 2021-06-25 22:59:39 -04:00
parent bc1029b9c5
commit f6370e2f05
2 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,13 @@
2021-06-25 Alexei Podtelezhnikov <apodtele@gmail.com>
[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 <apodtele@gmail.com>
* src/raster/ftraster.c (Render_Single_Pass): Remove dead code.

View File

@ -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,19 +3055,19 @@
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;
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++;
}