freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 5f19f49c8 1/2: [truetype] Move deallocation of `Delta


From: Werner Lemberg
Subject: [freetype2] master 5f19f49c8 1/2: [truetype] Move deallocation of `DeltaSetIdxMap` into own function.
Date: Thu, 19 May 2022 01:15:40 -0400 (EDT)

branch: master
commit 5f19f49c81d99ced0499cb3196139beb081dbfd0
Author: Dominik Röttsches <drott@chromium.org>
Commit: Werner Lemberg <wl@gnu.org>

    [truetype] Move deallocation of `DeltaSetIdxMap` into own function.
    
    This is a preparation for handling `DeltaSetIdxMap` and `VarStore` as a
    FreeType service.
    
    * src/truetype/ttgxvar.c (ft_var_done_delta_set_index_map): New function.
    (tt_done_blend): Use it.
---
 src/truetype/ttgxvar.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 224ce0e70..29c656a5d 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -4378,6 +4378,18 @@
   }
 
 
+  static void
+  ft_var_done_delta_set_index_map( TT_Face            face,
+                                   GX_DeltaSetIdxMap  deltaSetIdxMap )
+  {
+    FT_Memory  memory = FT_FACE_MEMORY( face );
+
+
+    FT_FREE( deltaSetIdxMap->innerIndex );
+    FT_FREE( deltaSetIdxMap->outerIndex );
+  }
+
+
   /**************************************************************************
    *
    * @Function:
@@ -4418,8 +4430,8 @@
         ft_var_done_item_variation_store( face,
                                           &blend->hvar_table->itemStore );
 
-        FT_FREE( blend->hvar_table->widthMap.innerIndex );
-        FT_FREE( blend->hvar_table->widthMap.outerIndex );
+        ft_var_done_delta_set_index_map( face,
+                                         &blend->hvar_table->widthMap );
         FT_FREE( blend->hvar_table );
       }
 
@@ -4428,8 +4440,8 @@
         ft_var_done_item_variation_store( face,
                                           &blend->vvar_table->itemStore );
 
-        FT_FREE( blend->vvar_table->widthMap.innerIndex );
-        FT_FREE( blend->vvar_table->widthMap.outerIndex );
+        ft_var_done_delta_set_index_map( face,
+                                         &blend->vvar_table->widthMap );
         FT_FREE( blend->vvar_table );
       }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]