Same thing for conic. Children arcs are small than the parent. If the
parent fits in the band, children do too.
A tiny off by one correction is a bonus.
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 40de269..0e26d7b 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -884,14 +884,37 @@ typedef ptrdiff_t FT_PtrDist;
arc[1].y = UPSCALE( control->y );
arc[2].x = ras.x;
arc[2].y = ras.y;
+ top = 0;
dx = FT_ABS( arc[2].x + arc[0].x - 2 * arc[1].x );
dy = FT_ABS( arc[2].y + arc[0].y - 2 * arc[1].y );
if ( dx < dy )
dx = dy;
+ if ( dx < ONE_PIXEL / 4 )
+ goto Draw;
+ else
+ {
+ /* short-cut the arc that crosses the current band */
+ TPos min, max, y;
+
+
+ min = max = arc[0].y;
+
+ y = arc[1].y;
+ if ( y < min ) min = y;
+ if ( y > max ) max = y;
+
+ y = arc[2].y;
+ if ( y < min ) min = y;
+ if ( y > max ) max = y;
+
+ if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey )
+ goto Draw;
+ }
+
level = 0;
- while ( dx > ONE_PIXEL / 6 )
+ while ( dx > ONE_PIXEL / 4 )
{
dx >>= 2;
level++;
@@ -899,30 +922,12 @@ typedef ptrdiff_t FT_PtrDist;
levels = ras.lev_stack;
levels[0] = level;
- top = 0;
do
{
level = levels[top];
- if ( level > 1 )
+ if ( level > 0 )
{
- /* check that the arc crosses the current band */
- TPos min, max, y;
-
-
- min = max = arc[0].y;
-
- y = arc[1].y;
- if ( y < min ) min = y;
- if ( y > max ) max = y;
-
- y = arc[2].y;
- if ( y < min ) min = y;
- if ( y > max ) max = y;
-
- if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey )
- goto Draw;
-
gray_split_conic( arc );
arc += 2;
top++;
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel