summaryrefslogtreecommitdiff
path: root/src/truetype/ttinterp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/truetype/ttinterp.c')
-rw-r--r--src/truetype/ttinterp.c57
1 files changed, 11 insertions, 46 deletions
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index ec8daae51..483bccc14 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -371,7 +371,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* TT_Destroy_Context */
+ /* TT_Done_Context */
/* */
/* <Description> */
/* Destroys a given context. */
@@ -388,9 +388,11 @@
/* Only the glyph loader and debugger should call this function. */
/* */
FT_LOCAL_DEF( FT_Error )
- TT_Destroy_Context( TT_ExecContext exec,
- FT_Memory memory )
+ TT_Done_Context( TT_ExecContext exec )
{
+ FT_Memory memory = exec->memory;
+
+
/* free composite load stack */
FT_FREE( exec->loadStack );
exec->loadSize = 0;
@@ -416,6 +418,7 @@
exec->face = NULL;
FT_FREE( exec );
+
return TT_Err_Ok;
}
@@ -431,8 +434,6 @@
/* <Input> */
/* memory :: A handle to the parent memory object. */
/* */
- /* face :: A handle to the source TrueType face object. */
- /* */
/* <InOut> */
/* exec :: A handle to the target execution context. */
/* */
@@ -441,14 +442,12 @@
/* */
static FT_Error
Init_Context( TT_ExecContext exec,
- TT_Face face,
FT_Memory memory )
{
FT_Error error;
- FT_TRACE1(( "Init_Context: new object at 0x%08p, parent = 0x%08p\n",
- exec, face ));
+ FT_TRACE1(( "Init_Context: new object at 0x%08p\n", exec ));
exec->memory = memory;
exec->callSize = 32;
@@ -469,7 +468,7 @@
exec->loadStack = NULL;
exec->glyphIns = NULL;
- exec->face = face;
+ exec->face = NULL;
exec->size = NULL;
return TT_Err_Ok;
@@ -477,7 +476,7 @@
Fail_Memory:
FT_ERROR(( "Init_Context: not enough memory for 0x%08lx\n",
(FT_Long)exec ));
- TT_Destroy_Context( exec, memory );
+ TT_Done_Context( exec );
return error;
}
@@ -770,18 +769,12 @@
/* documentation is in ttinterp.h */
FT_EXPORT_DEF( TT_ExecContext )
- TT_New_Context( TT_Face face )
+ TT_New_Context( TT_Driver driver )
{
- TT_Driver driver;
TT_ExecContext exec;
FT_Memory memory;
- if ( !face )
- return 0;
-
- driver = (TT_Driver)face->root.driver;
-
memory = driver->root.root.memory;
exec = driver->context;
@@ -795,7 +788,7 @@
goto Exit;
/* initialize it */
- error = Init_Context( exec, face, memory );
+ error = Init_Context( exec, memory );
if ( error )
goto Fail;
@@ -815,34 +808,6 @@
/*************************************************************************/
/* */
- /* <Function> */
- /* TT_Done_Context */
- /* */
- /* <Description> */
- /* Discards an execution context. */
- /* */
- /* <Input> */
- /* exec :: A handle to the target execution context. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Only the glyph loader and debugger should call this function. */
- /* */
- FT_LOCAL_DEF( FT_Error )
- TT_Done_Context( TT_ExecContext exec )
- {
- /* Nothing at all for now */
- FT_UNUSED( exec );
-
- return TT_Err_Ok;
- }
-
-
-
- /*************************************************************************/
- /* */
/* Before an opcode is executed, the interpreter verifies that there are */
/* enough arguments on the stack, with the help of the `Pop_Push_Count' */
/* table. */