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

Unified Diff: third_party/freetype/src/base/ftinit.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/ftgxval.c ('k') | third_party/freetype/src/base/ftlcdfil.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/freetype/src/base/ftinit.c
diff --git a/core/src/fxge/fx_freetype/fxft2.5.01/src/base/fxft_ftinit.c b/third_party/freetype/src/base/ftinit.c
similarity index 88%
rename from core/src/fxge/fx_freetype/fxft2.5.01/src/base/fxft_ftinit.c
rename to third_party/freetype/src/base/ftinit.c
index c7bf1f953754efaf89b7d6f97b06d04914646678..c4c88201a16045365b0b07c81aa10e9fb10c28ba 100644
--- a/core/src/fxge/fx_freetype/fxft2.5.01/src/base/fxft_ftinit.c
+++ b/third_party/freetype/src/base/ftinit.c
@@ -1,11 +1,10 @@
-#if !defined(_FXFT_VERSION_) || _FXFT_VERSION_ == 2501
/***************************************************************************/
/* */
/* ftinit.c */
/* */
/* FreeType initialization layer (body). */
/* */
-/* Copyright 1996-2002, 2005, 2007, 2009, 2012, 2013 by */
+/* Copyright 1996-2002, 2005, 2007, 2009, 2012-2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,8 +23,8 @@
/* FT_Add_Default_Modules(): */
/* This function is used to add the set of default modules to a */
/* fresh new library object. The set is taken from the header file */
- /* `freetype/config/ftmodule.h'. See the document `FreeType 2.0 */
- /* Build System' for more information. */
+ /* `config/ftmodule.h'. See the document `FreeType 2.0 Build */
+ /* System' for more information. */
/* */
/* FT_Init_FreeType(): */
/* This function creates a system object for the current platform, */
@@ -37,12 +36,12 @@
/* */
/*************************************************************************/
-#define FT2_BUILD_LIBRARY
-#include "../../include/ft2build.h"
-#include "../../include/freetype/config/ftconfig.h"
-#include "../../include/freetype/internal/ftobjs.h"
-#include "../../include/freetype/internal/ftdebug.h"
-#include "../../include/freetype/ftmodapi.h"
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_MODULE_H
#include "basepic.h"
@@ -66,7 +65,7 @@
#define FT_USE_MODULE( type, x ) extern const type x;
#endif
-#include "../../include/freetype/config/ftmodule.h"
+#include FT_CONFIG_MODULES_H
#undef FT_USE_MODULE
#define FT_USE_MODULE( type, x ) (const FT_Module_Class*)&(x),
@@ -74,7 +73,7 @@
static
const FT_Module_Class* const ft_default_modules[] =
{
-#include "../../include/freetype/config/ftmodule.h"
+#include FT_CONFIG_MODULES_H
0
};
@@ -98,7 +97,7 @@
FT_Destroy_Class_ ## x( FT_Library library, \
FT_Module_Class* clazz );
-#include "../../include/freetype/config/ftmodule.h"
+#include FT_CONFIG_MODULES_H
/* count all module classes */
#undef FT_USE_MODULE
@@ -106,7 +105,7 @@
enum
{
-#include "../../include/freetype/config/ftmodule.h"
+#include FT_CONFIG_MODULES_H
FT_NUM_MODULE_CLASSES
};
@@ -136,7 +135,7 @@
classes = pic_container->default_module_classes;
i = 0;
-#include "../../include/freetype/config/ftmodule.h"
+#include FT_CONFIG_MODULES_H
FT_FREE( classes );
pic_container->default_module_classes = 0;
@@ -178,7 +177,7 @@
i = 0;
-#include "../../include/freetype/config/ftmodule.h"
+#include FT_CONFIG_MODULES_H
Exit:
if ( error )
@@ -236,6 +235,8 @@
FT_Memory memory;
+ /* check of `alibrary' delayed to `FT_New_Library' */
+
/* First of all, allocate a new system object -- this function is part */
/* of the system-specific component, i.e. `ftsystem.c'. */
@@ -264,22 +265,22 @@
FT_EXPORT_DEF( FT_Error )
FT_Done_FreeType( FT_Library library )
{
- if ( library )
- {
- FT_Memory memory = library->memory;
+ FT_Memory memory;
- /* Discard the library object */
- FT_Done_Library( library );
+ if ( !library )
+ return FT_THROW( Invalid_Library_Handle );
- /* discard memory manager */
- FT_Done_Memory( memory );
- }
+ memory = library->memory;
+
+ /* Discard the library object */
+ FT_Done_Library( library );
+
+ /* discard memory manager */
+ FT_Done_Memory( memory );
return FT_Err_Ok;
}
/* END */
-#endif
-
« no previous file with comments | « third_party/freetype/src/base/ftgxval.c ('k') | third_party/freetype/src/base/ftlcdfil.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698