[raster,smooth] Microoptimizations.

* src/raster/ftraster.c (Insert_Y_Turn, Finalize_Profile_Table,
Beziier_Up, ): Use do-while loops.

* src/smooth/ftgrays.c (gray_render_scanline, gray_render_line,
gray_convert_glyph): Ditto.
This commit is contained in:
Alexei Podtelezhnikov 2015-09-04 23:14:46 -04:00
parent a9f6f04e56
commit 5a6dc87240
3 changed files with 22 additions and 14 deletions

View File

@ -1,3 +1,13 @@
2015-09-04 Alexei Podtelezhnikov <apodtele@gmail.com>
[raster,smooth] Microoptimizations.
* src/raster/ftraster.c (Insert_Y_Turn, Finalize_Profile_Table,
Beziier_Up, ): Use do-while loops.
* src/smooth/ftgrays.c (gray_render_scanline, gray_render_line,
gray_convert_glyph): Ditto.
2015-09-04 Werner Lemberg <wl@gnu.org>
[autofit] Redesign code ranges (2/2).

View File

@ -801,15 +801,14 @@
/* if it is <, simply insert it, ignore if == */
if ( n >= 0 && y > y_turns[n] )
while ( n >= 0 )
do
{
Int y2 = (Int)y_turns[n];
y_turns[n] = y;
y = y2;
n--;
}
} while ( --n >= 0 );
if ( n < 0 )
{
@ -850,7 +849,7 @@
if ( n > 1 && p )
{
while ( n > 0 )
do
{
Int bottom, top;
@ -878,8 +877,7 @@
return FAILURE;
p = p->link;
n--;
}
} while ( --n );
}
else
ras.fProfile = NULL;
@ -1250,7 +1248,7 @@
start_arc = arc;
while ( arc >= start_arc && e <= e2 )
do
{
ras.joint = FALSE;
@ -1283,7 +1281,7 @@
}
arc -= degree;
}
}
} while ( arc >= start_arc && e <= e2 );
Fin:
ras.top = top;

View File

@ -758,7 +758,7 @@ typedef ptrdiff_t FT_PtrDist;
mod -= (int)dx;
while ( ex1 != ex2 )
do
{
delta = lift;
mod += rem;
@ -773,7 +773,7 @@ typedef ptrdiff_t FT_PtrDist;
y1 += delta;
ex1 += incr;
gray_set_cell( RAS_VAR_ ex1, ey );
}
} while ( ex1 != ex2 );
}
delta = y2 - y1;
@ -896,7 +896,7 @@ typedef ptrdiff_t FT_PtrDist;
FT_DIV_MOD( int, p, dy, lift, rem );
mod -= (int)dy;
while ( ey1 != ey2 )
do
{
delta = lift;
mod += rem;
@ -914,7 +914,7 @@ typedef ptrdiff_t FT_PtrDist;
ey1 += incr;
gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 );
}
} while ( ey1 != ey2 );
}
gray_render_scanline( RAS_VAR_ ey1, x,
@ -1847,7 +1847,7 @@ typedef ptrdiff_t FT_PtrDist;
bands[0].max = max;
band = bands;
while ( band >= bands )
do
{
TPos bottom, top, middle;
int error;
@ -1923,7 +1923,7 @@ typedef ptrdiff_t FT_PtrDist;
band[0].min = middle;
band[0].max = top;
band++;
}
} while ( band >= bands );
}
if ( ras.band_shoot > 8 && ras.band_size > 16 )