[smooth] Fix Savannah bug #35604 (cont'd).
* src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and casts that became unnecessary after the variable type upgrades.
This commit is contained in:
parent
465ab99585
commit
c7fd93565c
|
@ -1,3 +1,10 @@
|
||||||
|
2014-10-30 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||||
|
|
||||||
|
[smooth] Fix Savannah bug #35604 (cont'd).
|
||||||
|
|
||||||
|
* src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and
|
||||||
|
casts that became unnecessary after the variable type upgrades.
|
||||||
|
|
||||||
2014-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
|
2014-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||||
|
|
||||||
[smooth] Improve code readability.
|
[smooth] Improve code readability.
|
||||||
|
|
|
@ -155,27 +155,8 @@
|
||||||
cbox.xMax = FT_PIX_CEIL( cbox.xMax );
|
cbox.xMax = FT_PIX_CEIL( cbox.xMax );
|
||||||
cbox.yMax = FT_PIX_CEIL( cbox.yMax );
|
cbox.yMax = FT_PIX_CEIL( cbox.yMax );
|
||||||
|
|
||||||
if ( cbox.xMin < 0 && cbox.xMax > FT_INT_MAX + cbox.xMin )
|
width = (FT_ULong)( cbox.xMax - cbox.xMin ) >> 6;
|
||||||
{
|
height = (FT_ULong)( cbox.yMax - cbox.yMin ) >> 6;
|
||||||
FT_ERROR(( "ft_smooth_render_generic: glyph too large:"
|
|
||||||
" xMin = %d, xMax = %d\n",
|
|
||||||
cbox.xMin >> 6, cbox.xMax >> 6 ));
|
|
||||||
error = FT_THROW( Raster_Overflow );
|
|
||||||
goto Exit;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
width = ( cbox.xMax - cbox.xMin ) >> 6;
|
|
||||||
|
|
||||||
if ( cbox.yMin < 0 && cbox.yMax > FT_INT_MAX + cbox.yMin )
|
|
||||||
{
|
|
||||||
FT_ERROR(( "ft_smooth_render_generic: glyph too large:"
|
|
||||||
" yMin = %d, yMax = %d\n",
|
|
||||||
cbox.yMin >> 6, cbox.yMax >> 6 ));
|
|
||||||
error = FT_THROW( Raster_Overflow );
|
|
||||||
goto Exit;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
height = ( cbox.yMax - cbox.yMin ) >> 6;
|
|
||||||
|
|
||||||
#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
||||||
width_org = width;
|
width_org = width;
|
||||||
|
@ -192,10 +173,10 @@
|
||||||
if ( vmul )
|
if ( vmul )
|
||||||
height *= 3;
|
height *= 3;
|
||||||
|
|
||||||
x_shift = (FT_Int) cbox.xMin;
|
x_shift = cbox.xMin;
|
||||||
y_shift = (FT_Int) cbox.yMin;
|
y_shift = cbox.yMin;
|
||||||
x_left = (FT_Int)( cbox.xMin >> 6 );
|
x_left = cbox.xMin >> 6;
|
||||||
y_top = (FT_Int)( cbox.yMax >> 6 );
|
y_top = cbox.yMax >> 6;
|
||||||
|
|
||||||
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
||||||
|
|
||||||
|
@ -222,8 +203,6 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FT_UINT_MAX > 0xFFFFU
|
|
||||||
|
|
||||||
/* Required check is (pitch * height < FT_ULONG_MAX), */
|
/* Required check is (pitch * height < FT_ULONG_MAX), */
|
||||||
/* but we care realistic cases only. Always pitch <= width. */
|
/* but we care realistic cases only. Always pitch <= width. */
|
||||||
if ( width > 0x7FFF || height > 0x7FFF )
|
if ( width > 0x7FFF || height > 0x7FFF )
|
||||||
|
@ -234,8 +213,6 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
|
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
|
||||||
bitmap->num_grays = 256;
|
bitmap->num_grays = 256;
|
||||||
bitmap->width = width;
|
bitmap->width = width;
|
||||||
|
|
Loading…
Reference in New Issue