ref: 5a6dc87240905f0e55568678e0fbf93a51242051
parent: a9f6f04e5671dc5c8961bc89ab343406259dd3cd
author: Alexei Podtelezhnikov <[email protected]>
date: Fri Sep 4 19:14:46 EDT 2015
[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.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-09-04 Alexei Podtelezhnikov <[email protected]>
+
+ [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 <[email protected]>
[autofit] Redesign code ranges (2/2).
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -801,7 +801,7 @@
/* 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];
@@ -808,8 +808,7 @@
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;
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -758,7 +758,7 @@
mod -= (int)dx;
- while ( ex1 != ex2 )
+ do
{
delta = lift;
mod += rem;
@@ -773,7 +773,7 @@
y1 += delta;
ex1 += incr;
gray_set_cell( RAS_VAR_ ex1, ey );
- }
+ } while ( ex1 != ex2 );
}
delta = y2 - y1;
@@ -896,7 +896,7 @@
FT_DIV_MOD( int, p, dy, lift, rem );
mod -= (int)dy;
- while ( ey1 != ey2 )
+ do
{
delta = lift;
mod += rem;
@@ -914,7 +914,7 @@
ey1 += incr;
gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 );
- }
+ } while ( ey1 != ey2 );
}
gray_render_scanline( RAS_VAR_ ey1, x,
@@ -1847,7 +1847,7 @@
bands[0].max = max;
band = bands;
- while ( band >= bands )
+ do
{
TPos bottom, top, middle;
int error;
@@ -1923,7 +1923,7 @@
band[0].min = middle;
band[0].max = top;
band++;
- }
+ } while ( band >= bands );
}
if ( ras.band_shoot > 8 && ras.band_size > 16 )