diff --git a/ChangeLog b/ChangeLog index 9e4e4c2b6..d40137f49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-08-08 Alexei Podtelezhnikov + + * src/smooth/ftsmooth.c (ft_smooth_render_generic): Clean up. + 2017-08-08 Alexei Podtelezhnikov * src/sftnt/ttpost.c (format): Use otspec-compliant versions. diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c index fd12e666a..11a739aa8 100644 --- a/src/smooth/ftsmooth.c +++ b/src/smooth/ftsmooth.c @@ -106,9 +106,6 @@ FT_Pos y_shift = 0; FT_Pos x_left, y_top; FT_Pos width, height, pitch; -#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING - FT_Pos height_org, width_org; -#endif FT_Int hmul = ( mode == FT_RENDER_MODE_LCD ); FT_Int vmul = ( mode == FT_RENDER_MODE_LCD_V ); @@ -195,7 +192,7 @@ #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING /* add minimal padding for LCD filter depending on specific weights */ - if ( lcd_filter_func) + if ( lcd_filter_func ) { if ( hmul ) { @@ -229,11 +226,6 @@ width = (FT_ULong)( cbox.xMax - cbox.xMin ) >> 6; height = (FT_ULong)( cbox.yMax - cbox.yMin ) >> 6; -#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING - width_org = width; - height_org = height; -#endif - pitch = width; if ( hmul ) { @@ -359,13 +351,13 @@ FT_UInt hh; - for ( hh = height_org; hh > 0; hh--, line += pitch ) + for ( hh = height; hh > 0; hh--, line += pitch ) { FT_UInt xx; FT_Byte* end = line + width; - for ( xx = width_org; xx > 0; xx-- ) + for ( xx = width / 3; xx > 0; xx-- ) { FT_UInt pixel = line[xx-1]; @@ -381,12 +373,12 @@ /* expand it vertically */ if ( vmul ) { - FT_Byte* read = bitmap->buffer + ( height - height_org ) * pitch; + FT_Byte* read = bitmap->buffer + ( height - height / 3 ) * pitch; FT_Byte* write = bitmap->buffer; FT_UInt hh; - for ( hh = height_org; hh > 0; hh-- ) + for ( hh = height / 3; hh > 0; hh-- ) { ft_memcpy( write, read, pitch ); write += pitch;