diff options
Diffstat (limited to 'src/base/ftbitmap.c')
-rw-r--r-- | src/base/ftbitmap.c | 58 |
1 files changed, 14 insertions, 44 deletions
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c index 4f5ca5a59..93efb0944 100644 --- a/src/base/ftbitmap.c +++ b/src/base/ftbitmap.c @@ -237,35 +237,20 @@ unsigned char* out = buffer; unsigned char* limit = bitmap->buffer + pitch * bitmap->rows; + unsigned int delta = new_pitch - pitch; FT_MEM_ZERO( out, new_pitch * ypixels ); out += new_pitch * ypixels; - if ( new_pitch > pitch ) + while ( in < limit ) { - unsigned int delta = new_pitch - pitch; + FT_MEM_COPY( out, in, len ); + in += pitch; + out += pitch; - - while ( in < limit ) - { - FT_MEM_COPY( out, in, len ); - in += pitch; - out += pitch; - - /* we have to zero out the new (unused) pitch bytes */ - FT_MEM_ZERO( out, delta ); - out += delta; - } - } - else - { - while ( in < limit ) - { - FT_MEM_COPY( out, in, len ); - in += pitch; - out += new_pitch; - } + FT_MEM_ZERO( out, delta ); + out += delta; } } else @@ -276,32 +261,17 @@ unsigned char* out = buffer; unsigned char* limit = bitmap->buffer + pitch * bitmap->rows; + unsigned int delta = new_pitch - pitch; - if ( new_pitch > pitch ) + while ( in < limit ) { - unsigned int delta = new_pitch - pitch; + FT_MEM_COPY( out, in, len ); + in += pitch; + out += pitch; - - while ( in < limit ) - { - FT_MEM_COPY( out, in, len ); - in += pitch; - out += pitch; - - /* we have to zero out the new (unused) pitch bytes */ - FT_MEM_ZERO( out, delta ); - out += delta; - } - } - else - { - while ( in < limit ) - { - FT_MEM_COPY( out, in, len ); - in += pitch; - out += new_pitch; - } + FT_MEM_ZERO( out, delta ); + out += delta; } FT_MEM_ZERO( out, new_pitch * ypixels ); |