Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/freetype/src/base/ftsystem.c

Issue 815103002: Update freetype to 2.5.4. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Adjust GYP and GN Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/freetype/src/base/ftsynth.c ('k') | third_party/freetype/src/base/fttrigon.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/freetype/src/base/ftsystem.c
diff --git a/core/src/fxge/fx_freetype/fxft2.5.01/src/base/fxft_ftsystem.c b/third_party/freetype/src/base/ftsystem.c
similarity index 87%
rename from core/src/fxge/fx_freetype/fxft2.5.01/src/base/fxft_ftsystem.c
rename to third_party/freetype/src/base/ftsystem.c
index ff7137fc1f55e1103dd330f270f59b68464ee351..2c6ddac10c2f9ce26a1275b7d041ce0077bfb154 100644
--- a/core/src/fxge/fx_freetype/fxft2.5.01/src/base/fxft_ftsystem.c
+++ b/third_party/freetype/src/base/ftsystem.c
@@ -1,4 +1,3 @@
-#if !defined(_FXFT_VERSION_) || _FXFT_VERSION_ == 2501
/***************************************************************************/
/* */
/* ftsystem.c */
@@ -25,14 +24,14 @@
/* */
/*************************************************************************/
-#define FT2_BUILD_LIBRARY
-#include "../../include/ft2build.h"
-#include "../../include/freetype/config/ftconfig.h"
-#include "../../include/freetype/internal/ftdebug.h"
-#include "../../include/freetype/internal/ftstream.h"
-#include "../../include/freetype/ftsystem.h"
-#include "../../include/freetype/fterrors.h"
-#include "../../include/freetype/fttypes.h"
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_STREAM_H
+#include FT_SYSTEM_H
+#include FT_ERRORS_H
+#include FT_TYPES_H
/*************************************************************************/
@@ -49,26 +48,7 @@
/* */
/*************************************************************************/
-#define _FOXIT_MEM_MANAGER_
-
-#if defined(_FX_MANAGED_CODE_) && defined(__cplusplus)
-extern "C" {
-#endif
-
-/** Allocate number of bytes */
-void* FXMEM_DefaultAlloc(int byte_size, int flags);
-
-/** Allocate with debug information */
-void* FXMEM_DefaultAllocDebug(int size, int flags, const char* file, int line);
-void* FXMEM_DefaultRealloc(void* pointer, int new_size, int flags);
-
-/** Free previously allocated memory */
-void FXMEM_DefaultFree(void* pointer, int flags);
-
-#if defined(_FX_MANAGED_CODE_) && defined(__cplusplus)
-}
-#endif
/*************************************************************************/
/* */
/* <Function> */
@@ -90,24 +70,10 @@ void FXMEM_DefaultFree(void* pointer, int flags);
long size )
{
FT_UNUSED( memory );
- #ifdef _FOXIT_MEM_MANAGER_
- return FXMEM_DefaultAlloc(size, 0);
-#else
+
return ft_smalloc( size );
-#endif
}
-
- /* XYQ 2006-10-12 */
-#ifdef _XYQ_MEM_DEBUG
- FT_CALLBACK_DEF( void* )
- ft_allocdebug( FT_Memory memory,
- long size, const char* filename, int line)
- {
- FT_UNUSED( memory );
-
- return FXMEM_DefaultAllocDebug( size, 0, filename, line );
- }
-#endif
+
/*************************************************************************/
/* */
@@ -138,11 +104,7 @@ void FXMEM_DefaultFree(void* pointer, int flags);
FT_UNUSED( memory );
FT_UNUSED( cur_size );
-#ifdef _FOXIT_MEM_MANAGER_
- return FXMEM_DefaultRealloc(block, new_size, 0);
-#else
return ft_srealloc( block, new_size );
-#endif
}
@@ -165,11 +127,7 @@ void FXMEM_DefaultFree(void* pointer, int flags);
{
FT_UNUSED( memory );
-#ifdef _FOXIT_MEM_MANAGER_
- FXMEM_DefaultFree(block, 0);
-#else
ft_sfree( block );
-#endif
}
@@ -209,13 +167,11 @@ void FXMEM_DefaultFree(void* pointer, int flags);
FT_CALLBACK_DEF( void )
ft_ansi_stream_close( FT_Stream stream )
{
-//#if _FX_COMPILER_ != _FX_IARCC_ && _FX_OS_ != _FX_PALMOS_
ft_fclose( STREAM_FILE( stream ) );
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = 0;
-//#endif
}
@@ -247,7 +203,6 @@ void FXMEM_DefaultFree(void* pointer, int flags);
unsigned char* buffer,
unsigned long count )
{
-//#if _FX_COMPILER_ != _FX_IARCC_ && _FX_OS_ != _FX_PALMOS_
FT_FILE* file;
@@ -260,9 +215,6 @@ void FXMEM_DefaultFree(void* pointer, int flags);
ft_fseek( file, offset, SEEK_SET );
return (unsigned long)ft_fread( buffer, 1, count, file );
-//#else
-// return 0;
-//#endif
}
@@ -272,7 +224,6 @@ void FXMEM_DefaultFree(void* pointer, int flags);
FT_Stream_Open( FT_Stream stream,
const char* filepathname )
{
-//#if _FX_COMPILER_ != _FX_IARCC_ && _FX_OS_ != _FX_PALMOS_
FT_FILE* file;
@@ -295,7 +246,7 @@ void FXMEM_DefaultFree(void* pointer, int flags);
return FT_THROW( Cannot_Open_Resource );
}
- ft_fseek( file, 0, FXSYS_SEEK_END );
+ ft_fseek( file, 0, SEEK_END );
stream->size = ft_ftell( file );
if ( !stream->size )
{
@@ -304,7 +255,7 @@ void FXMEM_DefaultFree(void* pointer, int flags);
ft_fclose( file );
return FT_THROW( Cannot_Open_Stream );
}
- ft_fseek( file, 0, FXSYS_SEEK_SET );
+ ft_fseek( file, 0, SEEK_SET );
stream->descriptor.pointer = file;
stream->read = ft_ansi_stream_io;
@@ -313,7 +264,6 @@ void FXMEM_DefaultFree(void* pointer, int flags);
FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
filepathname, stream->size ));
-//#endif
return FT_Err_Ok;
}
@@ -339,14 +289,11 @@ void FXMEM_DefaultFree(void* pointer, int flags);
FT_Memory memory;
- memory = (FT_Memory)FXMEM_DefaultAlloc( sizeof ( *memory ), 0 );
+ memory = (FT_Memory)ft_smalloc( sizeof ( *memory ) );
if ( memory )
{
memory->user = 0;
memory->alloc = ft_alloc;
-#ifdef _XYQ_MEM_DEBUG
- memory->allocdebug = ft_allocdebug;
-#endif
memory->realloc = ft_realloc;
memory->free = ft_free;
#ifdef FT_DEBUG_MEMORY
@@ -366,10 +313,8 @@ void FXMEM_DefaultFree(void* pointer, int flags);
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_done( memory );
#endif
- FXMEM_DefaultFree( memory, 0 );
+ ft_sfree( memory );
}
/* END */
-#endif
-
« no previous file with comments | « third_party/freetype/src/base/ftsynth.c ('k') | third_party/freetype/src/base/fttrigon.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698