[smooth] Variable type revision (part 2). * src/smooth/ftgrays.c (TArea): Restore original definition as `int'. (gray_render_line) [FT_LONG64]: Updated. (gray_convert_glyph): 32-bit band bisection stack should be 32 bands. (gray_convert_glyph_inner): Trace successes and failures.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
diff --git a/ChangeLog b/ChangeLog
index 0fb1465..25014ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-07-04 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [smooth] Variable type revision (part 2).
+
+ * src/smooth/ftgrays.c (TArea): Restore original definition as `int'.
+ (gray_render_line) [FT_LONG64]: Updated.
+ (gray_convert_glyph): 32-bit band bisection stack should be 32 bands.
+ (gray_convert_glyph_inner): Trace successes and failures.
+
2016-07-04 Werner Lemberg <wl@gnu.org>
[autofit] Handle single-point contours as segments.
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 8eade1c..f0e380e 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -387,9 +387,9 @@ typedef ptrdiff_t FT_PtrDist;
/* need to define them to "float" or "double" when experimenting with */
/* new algorithms */
- typedef int TCoord; /* integer scanline/pixel coordinate */
typedef long TPos; /* sub-pixel coordinate */
- typedef long TArea; /* cell areas, coordinate products */
+ typedef int TCoord; /* integer scanline/pixel coordinate */
+ typedef int TArea; /* cell areas, coordinate products */
typedef struct TCell_* PCell;
@@ -493,7 +493,7 @@ typedef ptrdiff_t FT_PtrDist;
printf( "%3d:", yindex );
for ( cell = ras.ycells[yindex]; cell != NULL; cell = cell->next )
- printf( " (%3d, c:%4d, a:%6ld)",
+ printf( " (%3d, c:%4d, a:%6d)",
cell->x, cell->cover, cell->area );
printf( "\n" );
}
@@ -928,7 +928,7 @@ typedef ptrdiff_t FT_PtrDist;
}
else /* any other line */
{
- TArea prod = dx * fy1 - dy * fx1;
+ TPos prod = dx * fy1 - dy * fx1;
FT_UDIVPREP( dx );
FT_UDIVPREP( dy );
@@ -1873,10 +1873,18 @@ typedef ptrdiff_t FT_PtrDist;
error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras );
if ( !ras.invalid )
gray_record_cell( RAS_VAR );
+
+ FT_TRACE7(( "band [%d..%d]: %d cells\n",
+ ras.min_ey, ras.max_ey, ras.num_cells ));
}
else
+ {
error = FT_THROW( Memory_Overflow );
+ FT_TRACE7(( "band [%d..%d]: to be bisected\n",
+ ras.min_ey, ras.max_ey ));
+ }
+
return error;
}
@@ -1886,7 +1894,7 @@ typedef ptrdiff_t FT_PtrDist;
{
TCell buffer[FT_MAX_GRAY_POOL];
const int band_size = FT_MAX_GRAY_POOL / 8;
- gray_TBand bands[40];
+ gray_TBand bands[32];
gray_TBand* band;
int n, num_bands;
TCoord min, max, max_y;