[cache] Optimize SBit copying.
* src/cache/ftcsbits.c (ftc_snode_load): Do not initialize the buffer. (ftc_sbit_copy_bitmap): Accept zero size, s/FT_ALLOC/FT_QALLOC/.
This commit is contained in:
parent
93715ab2c4
commit
23f85c8a98
@ -1,3 +1,10 @@
|
||||
2021-04-22 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||
|
||||
[cache] Optimize SBit copying.
|
||||
|
||||
* src/cache/ftcsbits.c (ftc_snode_load): Do not initialize the buffer.
|
||||
(ftc_sbit_copy_bitmap): Accept zero size, s/FT_ALLOC/FT_QALLOC/.
|
||||
|
||||
2021-04-22 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||
|
||||
[gxvalid,otvalid] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
|
||||
|
6
src/cache/ftcsbits.c
vendored
6
src/cache/ftcsbits.c
vendored
@ -52,10 +52,8 @@
|
||||
pitch = -pitch;
|
||||
|
||||
size = (FT_ULong)pitch * bitmap->rows;
|
||||
if ( !size )
|
||||
return FT_Err_Ok;
|
||||
|
||||
if ( !FT_ALLOC( sbit->buffer, size ) )
|
||||
if ( !FT_QALLOC( sbit->buffer, size ) )
|
||||
FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );
|
||||
|
||||
return error;
|
||||
@ -122,8 +120,6 @@
|
||||
sbit = snode->sbits + ( gindex - gnode->gindex );
|
||||
clazz = (FTC_SFamilyClass)family->clazz;
|
||||
|
||||
sbit->buffer = NULL;
|
||||
|
||||
error = clazz->family_load_glyph( family, gindex, manager, &face );
|
||||
if ( error )
|
||||
goto BadGlyph;
|
||||
|
Loading…
Reference in New Issue
Block a user