diff --git a/ChangeLog b/ChangeLog index 73c8eb8a0..6dea0e313 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-11-21 Werner Lemberg + + [ftlcdfil] Obey flow direction. + + * src/base/ftlcdfil.c (_ft_lcd_filter_fir, _ft_lcd_filter_legacy): + Handle `up' flow. + 2014-11-21 Werner Lemberg * src/base/ftbitmap.c (FT_Bitmap_Convert): Improve. diff --git a/src/base/ftlcdfil.c b/src/base/ftlcdfil.c index 4aefb687c..1f23c4c12 100644 --- a/src/base/ftlcdfil.c +++ b/src/base/ftlcdfil.c @@ -46,6 +46,10 @@ FT_Byte* line = bitmap->buffer; + /* take care of bitmap flow */ + if ( bitmap->pitch < 0 ) + line -= bitmap->pitch * ( bitmap->rows - 1 ); + /* `fir' and `pix' must be at least 32 bit wide, since the sum of */ /* the values in `weights' can exceed 0xFF */ @@ -106,6 +110,10 @@ FT_Int pitch = bitmap->pitch; + /* take care of bitmap flow */ + if ( bitmap->pitch < 0 ) + column -= bitmap->pitch * ( bitmap->rows - 1 ); + for ( ; width > 0; width--, column++ ) { FT_Byte* col = column; @@ -190,6 +198,10 @@ FT_Byte* line = bitmap->buffer; + /* take care of bitmap flow */ + if ( bitmap->pitch < 0 ) + line -= bitmap->pitch * ( bitmap->rows - 1 ); + for ( ; height > 0; height--, line += pitch ) { FT_UInt xx; @@ -229,6 +241,10 @@ FT_Byte* column = bitmap->buffer; + /* take care of bitmap flow */ + if ( bitmap->pitch < 0 ) + column -= bitmap->pitch * ( bitmap->rows - 1 ); + for ( ; width > 0; width--, column++ ) { FT_Byte* col = column;