[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>
|
2021-04-22 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||||
|
|
||||||
[gxvalid,otvalid] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
|
[gxvalid,otvalid] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
|
||||||
|
|
|
@ -52,10 +52,8 @@
|
||||||
pitch = -pitch;
|
pitch = -pitch;
|
||||||
|
|
||||||
size = (FT_ULong)pitch * bitmap->rows;
|
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 );
|
FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
@ -122,8 +120,6 @@
|
||||||
sbit = snode->sbits + ( gindex - gnode->gindex );
|
sbit = snode->sbits + ( gindex - gnode->gindex );
|
||||||
clazz = (FTC_SFamilyClass)family->clazz;
|
clazz = (FTC_SFamilyClass)family->clazz;
|
||||||
|
|
||||||
sbit->buffer = NULL;
|
|
||||||
|
|
||||||
error = clazz->family_load_glyph( family, gindex, manager, &face );
|
error = clazz->family_load_glyph( family, gindex, manager, &face );
|
||||||
if ( error )
|
if ( error )
|
||||||
goto BadGlyph;
|
goto BadGlyph;
|
||||||
|
|
Loading…
Reference in New Issue