summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2016-07-04 23:46:53 -0400
committerAlexei Podtelezhnikov <apodtele@gmail.com>2016-07-04 23:46:53 -0400
commitd1876e5832300b09529fbfe4cefbbab92e9e15a3 (patch)
tree3bac1c710e91615f7d08e9beb89faa5e404952fc
parent5e353f07865a5ffbc141fe26cd377469693bcdcd (diff)
downloadfreetype2-d1876e5832300b09529fbfe4cefbbab92e9e15a3.tar.gz
[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.
-rw-r--r--ChangeLog9
-rw-r--r--src/smooth/ftgrays.c18
2 files changed, 22 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fb146516..25014ef16 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 8eade1c93..f0e380e40 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;