summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-08-29 06:19:44 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-08-29 06:19:44 +0000
commit0de5be92a3a0fe27e8521fc4de67e19b1057842e (patch)
treee93a390fe965486cca19498840cb8d7904252fec /Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c
parent27ce96eea3f1190bd744448cfa149e8d767af95a (diff)
revert freetype to 2.10.4
git-svn-id: svn://tug.org/texlive/trunk@60360 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c b/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c
index 7e24d81d93d..e0db930af8e 100644
--- a/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c
+++ b/Build/source/libs/freetype2/freetype-src/src/cache/ftcsbits.c
@@ -4,7 +4,7 @@
*
* FreeType sbits manager (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2020 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -52,8 +52,10 @@
pitch = -pitch;
size = (FT_ULong)pitch * bitmap->rows;
+ if ( !size )
+ return FT_Err_Ok;
- if ( !FT_QALLOC( sbit->buffer, size ) )
+ if ( !FT_ALLOC( sbit->buffer, size ) )
FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );
return error;
@@ -106,6 +108,7 @@
FT_Error error;
FTC_GNode gnode = FTC_GNODE( snode );
FTC_Family family = gnode->family;
+ FT_Memory memory = manager->memory;
FT_Face face;
FTC_SBit sbit;
FTC_SFamilyClass clazz;
@@ -120,6 +123,8 @@
sbit = snode->sbits + ( gindex - gnode->gindex );
clazz = (FTC_SFamilyClass)family->clazz;
+ sbit->buffer = 0;
+
error = clazz->family_load_glyph( family, gindex, manager, &face );
if ( error )
goto BadGlyph;
@@ -138,13 +143,12 @@
goto BadGlyph;
}
- /* Check whether our values fit into 8/16-bit containers! */
+ /* Check whether our values fit into 8-bit containers! */
/* If this is not the case, our bitmap is too large */
/* and we will leave it as `missing' with sbit.buffer = 0 */
#define CHECK_CHAR( d ) ( temp = (FT_Char)d, (FT_Int) temp == (FT_Int) d )
#define CHECK_BYTE( d ) ( temp = (FT_Byte)d, (FT_UInt)temp == (FT_UInt)d )
-#define CHECK_SHRT( d ) ( temp = (FT_Short)d, (FT_Int)temp == (FT_Int) d )
/* horizontal advance in pixels */
xadvance = ( slot->advance.x + 32 ) >> 6;
@@ -152,7 +156,7 @@
if ( !CHECK_BYTE( bitmap->rows ) ||
!CHECK_BYTE( bitmap->width ) ||
- !CHECK_SHRT( bitmap->pitch ) ||
+ !CHECK_CHAR( bitmap->pitch ) ||
!CHECK_CHAR( slot->bitmap_left ) ||
!CHECK_CHAR( slot->bitmap_top ) ||
!CHECK_CHAR( xadvance ) ||
@@ -165,7 +169,7 @@
sbit->width = (FT_Byte)bitmap->width;
sbit->height = (FT_Byte)bitmap->rows;
- sbit->pitch = (FT_Short)bitmap->pitch;
+ sbit->pitch = (FT_Char)bitmap->pitch;
sbit->left = (FT_Char)slot->bitmap_left;
sbit->top = (FT_Char)slot->bitmap_top;
sbit->xadvance = (FT_Char)xadvance;
@@ -173,17 +177,8 @@
sbit->format = (FT_Byte)bitmap->pixel_mode;
sbit->max_grays = (FT_Byte)(bitmap->num_grays - 1);
- if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
- {
- /* take the bitmap ownership */
- sbit->buffer = bitmap->buffer;
- slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
- }
- else
- {
- /* copy the bitmap into a new buffer -- ignore error */
- error = ftc_sbit_copy_bitmap( sbit, bitmap, manager->memory );
- }
+ /* copy the bitmap into a new buffer -- ignore error */
+ error = ftc_sbit_copy_bitmap( sbit, bitmap, memory );
/* now, compute size */
if ( asize )
@@ -395,7 +390,7 @@
{
error = ftc_snode_load( snode, cache->manager, gindex, &size );
}
- FTC_CACHE_TRYLOOP_END( list_changed )
+ FTC_CACHE_TRYLOOP_END( list_changed );
ftcsnode->ref_count--; /* unlock the node */