[HarfBuzz] harfbuzz: Branch 'master' - 8 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Jun 12 05:17:30 UTC 2018


 appveyor.yml                         |    2 +-
 src/hb-ot-layout-gsub-table.hh       |    7 +++----
 src/hb-ot-layout-gsubgpos-private.hh |    6 +++---
 src/hb-ot-layout.cc                  |    4 +++-
 src/hb-private.hh                    |    3 +++
 src/hb-set-private.hh                |   10 +++++++---
 test/api/test-set.c                  |    6 ++++++
 7 files changed, 26 insertions(+), 12 deletions(-)

New commits:
commit ba0ea56efab9caa942d59bf51c78e490969cab87
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jun 11 23:24:41 2018 -0400

    [substitute-closure] Rename function for clarity

diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index 4921abee..bd72fe6b 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -1159,7 +1159,7 @@ struct SubstLookup : Lookup
   inline hb_closure_context_t::return_t closure (hb_closure_context_t *c, unsigned int this_index) const
   {
     TRACE_CLOSURE (this);
-    if (!c->start_lookup (this_index))
+    if (!c->should_visit_lookup (this_index))
       return_trace (HB_VOID);
 
     c->set_recurse_func (dispatch_closure_recurse_func);
@@ -1263,7 +1263,7 @@ struct SubstLookup : Lookup
 
   static inline hb_closure_context_t::return_t dispatch_closure_recurse_func (hb_closure_context_t *c, unsigned int lookup_index)
   {
-    if (!c->start_lookup (lookup_index))
+    if (!c->should_visit_lookup (lookup_index))
       return HB_VOID;
     return dispatch_recurse_func (c, lookup_index);
   }
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index 1f899d1e..661085d5 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -60,7 +60,7 @@ struct hb_closure_context_t :
     return HB_VOID;
   }
 
-  bool start_lookup (unsigned int lookup_index)
+  bool should_visit_lookup (unsigned int lookup_index)
   {
     if (is_lookup_done (lookup_index))
       return false;
commit 7b5ce416383101cb9d72a775a32d0088984e6817
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jun 11 23:23:40 2018 -0400

    Whitespace

diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index 34d9d6e9..4921abee 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -1261,8 +1261,7 @@ struct SubstLookup : Lookup
   template <typename context_t>
   static inline typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index);
 
-  static inline hb_closure_context_t::return_t dispatch_closure_recurse_func
-  (hb_closure_context_t *c, unsigned int lookup_index)
+  static inline hb_closure_context_t::return_t dispatch_closure_recurse_func (hb_closure_context_t *c, unsigned int lookup_index)
   {
     if (!c->start_lookup (lookup_index))
       return HB_VOID;
commit c4d0d11c55f018026fc9c1db75fe7a4f8a38f81f
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jun 11 22:11:45 2018 -0400

    [vector] Always 0-fill new items

diff --git a/src/hb-private.hh b/src/hb-private.hh
index ac00e022..32e33549 100644
--- a/src/hb-private.hh
+++ b/src/hb-private.hh
@@ -716,6 +716,9 @@ struct hb_vector_t
     if (!alloc (size))
       return false;
 
+    if (size > len)
+      memset (arrayZ + len, 0, (size - len) * sizeof (*arrayZ));
+
     len = size;
     return true;
   }
commit a7e1b4a3b2d7b853ca244156571dd83321739bb1
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jun 11 22:05:08 2018 -0400

    Fix compiler warning re reordering of initializations

diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index b4a9bf19..1f899d1e 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -86,10 +86,10 @@ struct hb_closure_context_t :
 		        unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
 			  face (face_),
 			  glyphs (glyphs_),
-                          done_lookups (done_lookups_),
 			  recurse_func (nullptr),
 			  nesting_level_left (nesting_level_left_),
-			  debug_depth (0) {}
+			  debug_depth (0),
+                          done_lookups (done_lookups_) {}
 
   void set_recurse_func (recurse_func_t func) { recurse_func = func; }
 
commit f56cd9df10824fbbef52172470d07ff673d460cc
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jun 11 22:02:38 2018 -0400

    Style

diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index e8d4bcae..655c36c1 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -977,7 +977,9 @@ hb_ot_layout_lookups_substitute_closure (hb_face_t      *face,
     {
       for (hb_codepoint_t lookup_index = HB_SET_VALUE_INVALID; hb_set_next (lookups, &lookup_index);)
         gsub.get_lookup (lookup_index).closure (&c, lookup_index);
-    } else {
+    }
+    else
+    {
       for (unsigned int i = 0; i < gsub.get_lookup_count (); i++)
         gsub.get_lookup (i).closure (&c, i);
     }
commit a95cde15af4aa34e76c4394dfdf17e7d25164d5b
Author: Jonathan Kew <jfkthame at gmail.com>
Date:   Mon Jun 11 18:09:35 2018 -0700

    [hb-set] Additional testcase for hb-set-intersect.

diff --git a/test/api/test-set.c b/test/api/test-set.c
index e6590f45..338a610c 100644
--- a/test/api/test-set.c
+++ b/test/api/test-set.c
@@ -254,6 +254,12 @@ test_set_algebra (void)
   g_assert_cmpint (hb_set_get_population (o), ==, 1);
   g_assert (hb_set_has (o, 889));
 
+  hb_set_add (o, 511);
+  g_assert_cmpint (hb_set_get_population (o), ==, 2);
+  hb_set_intersect (o, s);
+  g_assert_cmpint (hb_set_get_population (o), ==, 1);
+  g_assert (hb_set_has (o, 889));
+
   hb_set_destroy (s);
   hb_set_destroy (o);
 }
commit 82484b05ca7a51dec6f3f9e9b0d7967823d7657f
Author: Jonathan Kew <jfkthame at gmail.com>
Date:   Mon Jun 11 20:55:14 2018 -0700

    [hb-set] Don't shrink vectors until after processing their contents.
    
    Fixes #1054.

diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh
index ed753e68..ccd4d8df 100644
--- a/src/hb-set-private.hh
+++ b/src/hb-set-private.hh
@@ -424,7 +424,7 @@ struct hb_set_t
     unsigned int nb = other->pages.len;
     unsigned int next_page = na;
 
-    unsigned int count = 0;
+    unsigned int count = 0, newCount = 0;
     unsigned int a = 0, b = 0;
     for (; a < na && b < nb; )
     {
@@ -452,8 +452,10 @@ struct hb_set_t
     if (Op::passthru_right)
       count += nb - b;
 
-    if (!resize (count))
-      return;
+    if (count > pages.len)
+      if (!resize (count))
+        return;
+    newCount = count;
 
     /* Process in-place backward. */
     a = na;
@@ -506,6 +508,8 @@ struct hb_set_t
 	page_at (count).v = other->page_at (b).v;
       }
     assert (!count);
+    if (pages.len > newCount)
+      resize (newCount);
   }
 
   inline void union_ (const hb_set_t *other)
commit eb585033cae33ca069bbcdaa21e4074678b6a6e9
Author: Ebrahim Byagowi <ebrahim at gnu.org>
Date:   Mon Jun 11 03:47:43 2018 +0430

    Fetch the updated dwrite_1.h header from a better place
    
    Following to https://ci.appveyor.com/project/harfbuzz/harfbuzz/build/1.0.1693/job/mfkjdhcdykjuqdfc

diff --git a/appveyor.yml b/appveyor.yml
index b6857206..05a72d96 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -44,7 +44,7 @@ build_script:
   - 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" ctest --output-on-failure -C %configuration%'
 
   - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-$MSYS2_ARCH-{freetype,cairo,icu,gettext,gobject-introspection,gcc,gcc-libs,glib2,graphite2,pkg-config,python2}"'
-  - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "curl https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/include/dwrite_1.h?format=raw > %MINGW_PREFIX%/%MINGW_CHOST%/include/dwrite_1.h"'
+  - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "curl https://raw.githubusercontent.com/mirror/mingw-w64/023eb04c396d4e8d8fcf604cfababc53dae13398/mingw-w64-headers/include/dwrite_1.h > %MINGW_PREFIX%/%MINGW_CHOST%/include/dwrite_1.h"'
   - 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; PATH=$PATH:/mingw64/bin:/mingw32/bin; ./autogen.sh --with-uniscribe --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 --with-directwrite --build=%MINGW_CHOST% --host=%MINGW_CHOST% --prefix=%MINGW_PREFIX%; make; make check || .ci/fail.sh"'
 
 cache:


More information about the HarfBuzz mailing list