[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Aug 30 01:11:13 UTC 2018


 src/hb-subset-plan.cc            |    3 +--
 src/hb-subset-plan.hh            |    1 -
 src/hb-subset.cc                 |   39 +++------------------------------------
 src/hb-subset.h                  |   16 +---------------
 test/api/hb-subset-test.h        |    4 +---
 test/api/test-subset-hdmx.c      |    8 ++------
 test/api/test-subset-hmtx.c      |    4 +---
 test/api/test-subset.c           |   12 +++---------
 test/fuzzing/hb-subset-fuzzer.cc |    5 +----
 util/hb-subset.cc                |    4 +---
 10 files changed, 14 insertions(+), 82 deletions(-)

New commits:
commit f39166f0c0c09fac7874fda6b0b0825f20768e3e
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Aug 29 18:09:55 2018 -0700

    [subset] Remove unused hb_subset_profile_t
    
    We might reintroduce it later, but for now remove, as it was unused.
    Some things that should have been in this object (drop_hints, etc)
    are already in hb_subset_input_t.  So, for now, keep everything there.

diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc
index 1f643dc0..7efa1c19 100644
--- a/src/hb-subset-plan.cc
+++ b/src/hb-subset-plan.cc
@@ -135,7 +135,7 @@ _create_old_gid_to_new_gid_map (const hb_vector_t<hb_codepoint_t> &glyphs,
 /**
  * hb_subset_plan_create:
  * Computes a plan for subsetting the supplied face according
- * to a provide profile and input. The plan describes
+ * to a provided input. The plan describes
  * which tables and glyphs should be retained.
  *
  * Return value: New subset plan.
@@ -144,7 +144,6 @@ _create_old_gid_to_new_gid_map (const hb_vector_t<hb_codepoint_t> &glyphs,
  **/
 hb_subset_plan_t *
 hb_subset_plan_create (hb_face_t           *face,
-                       hb_subset_profile_t *profile,
                        hb_subset_input_t   *input)
 {
   hb_subset_plan_t *plan = hb_object_create<hb_subset_plan_t> ();
diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh
index 0f44f4b2..a5be50a6 100644
--- a/src/hb-subset-plan.hh
+++ b/src/hb-subset-plan.hh
@@ -97,7 +97,6 @@ typedef struct hb_subset_plan_t hb_subset_plan_t;
 
 HB_INTERNAL hb_subset_plan_t *
 hb_subset_plan_create (hb_face_t           *face,
-                       hb_subset_profile_t *profile,
                        hb_subset_input_t   *input);
 
 HB_INTERNAL void
diff --git a/src/hb-subset.cc b/src/hb-subset.cc
index 1ba16059..1695d371 100644
--- a/src/hb-subset.cc
+++ b/src/hb-subset.cc
@@ -43,37 +43,6 @@
 #include "hb-ot-post-table.hh"
 
 
-struct hb_subset_profile_t {
-  hb_object_header_t header;
-  ASSERT_POD ();
-};
-
-/**
- * hb_subset_profile_create:
- *
- * Return value: New profile with default settings.
- *
- * Since: 1.8.0
- **/
-hb_subset_profile_t *
-hb_subset_profile_create ()
-{
-  return hb_object_create<hb_subset_profile_t>();
-}
-
-/**
- * hb_subset_profile_destroy:
- *
- * Since: 1.8.0
- **/
-void
-hb_subset_profile_destroy (hb_subset_profile_t *profile)
-{
-  if (!hb_object_destroy (profile)) return;
-
-  free (profile);
-}
-
 template<typename TableType>
 static bool
 _subset (hb_subset_plan_t *plan)
@@ -198,19 +167,17 @@ _should_drop_table(hb_subset_plan_t *plan, hb_tag_t tag)
 /**
  * hb_subset:
  * @source: font face data to be subset.
- * @profile: profile to use for the subsetting.
  * @input: input to use for the subsetting.
  *
- * Subsets a font according to provided profile and input.
+ * Subsets a font according to provided input.
  **/
 hb_face_t *
 hb_subset (hb_face_t *source,
-           hb_subset_profile_t *profile,
            hb_subset_input_t *input)
 {
-  if (unlikely (!profile || !input || !source)) return hb_face_get_empty();
+  if (unlikely (!input || !source)) return hb_face_get_empty();
 
-  hb_subset_plan_t *plan = hb_subset_plan_create (source, profile, input);
+  hb_subset_plan_t *plan = hb_subset_plan_create (source, input);
 
   hb_tag_t table_tags[32];
   unsigned int offset = 0, count;
diff --git a/src/hb-subset.h b/src/hb-subset.h
index 8b7fcc6c..3b39706d 100644
--- a/src/hb-subset.h
+++ b/src/hb-subset.h
@@ -32,20 +32,6 @@
 HB_BEGIN_DECLS
 
 /*
- * hb_subset_profile_t
- * Things that change based on target environment, e.g. OS.
- * Threadsafe for multiple concurrent subset operations.
- */
-
-typedef struct hb_subset_profile_t hb_subset_profile_t;
-
-HB_EXTERN hb_subset_profile_t *
-hb_subset_profile_create (void);
-
-HB_EXTERN void
-hb_subset_profile_destroy (hb_subset_profile_t *profile);
-
-/*
  * hb_subset_input_t
  *
  * Things that change based on the input. Characters to keep, etc.
@@ -74,10 +60,10 @@ hb_subset_input_drop_hints (hb_subset_input_t *subset_input);
 HB_EXTERN hb_bool_t *
 hb_subset_input_drop_ot_layout (hb_subset_input_t *subset_input);
 
+
 /* hb_subset() */
 HB_EXTERN hb_face_t *
 hb_subset (hb_face_t *source,
-	   hb_subset_profile_t *profile,
            hb_subset_input_t *input);
 
 
diff --git a/test/api/hb-subset-test.h b/test/api/hb-subset-test.h
index c34f394b..afd553a0 100644
--- a/test/api/hb-subset-test.h
+++ b/test/api/hb-subset-test.h
@@ -72,11 +72,9 @@ static inline hb_face_t *
 hb_subset_test_create_subset (hb_face_t *source,
                               hb_subset_input_t *input)
 {
-  hb_subset_profile_t *profile = hb_subset_profile_create();
-  hb_face_t *subset = hb_subset (source, profile, input);
+  hb_face_t *subset = hb_subset (source, input);
   g_assert (subset);
 
-  hb_subset_profile_destroy (profile);
   hb_subset_input_destroy (input);
   return subset;
 }
diff --git a/test/api/test-subset-hdmx.c b/test/api/test-subset-hdmx.c
index c78009b6..22fcb411 100644
--- a/test/api/test-subset-hdmx.c
+++ b/test/api/test-subset-hdmx.c
@@ -61,13 +61,11 @@ test_subset_hdmx_invalid (void)
   hb_set_add (codepoints, 'b');
   hb_set_add (codepoints, 'c');
 
-  hb_subset_profile_t *profile = hb_subset_profile_create();
-  hb_face_t *subset = hb_subset (face, profile, input);
+  hb_face_t *subset = hb_subset (face, input);
   g_assert (subset);
   g_assert (subset == hb_face_get_empty ());
 
   hb_subset_input_destroy (input);
-  hb_subset_profile_destroy (profile);
   hb_face_destroy (subset);
   hb_face_destroy (face);
 }
@@ -83,13 +81,11 @@ test_subset_hdmx_fails_sanitize (void)
   hb_set_add (codepoints, 'b');
   hb_set_add (codepoints, 'c');
 
-  hb_subset_profile_t *profile = hb_subset_profile_create();
-  hb_face_t *subset = hb_subset (face, profile, input);
+  hb_face_t *subset = hb_subset (face, input);
   g_assert (subset);
   g_assert (subset == hb_face_get_empty ());
 
   hb_subset_input_destroy (input);
-  hb_subset_profile_destroy (profile);
   hb_face_destroy (subset);
   hb_face_destroy (face);
 }
diff --git a/test/api/test-subset-hmtx.c b/test/api/test-subset-hmtx.c
index 0ed62562..8b57ca7c 100644
--- a/test/api/test-subset-hmtx.c
+++ b/test/api/test-subset-hmtx.c
@@ -161,13 +161,11 @@ test_subset_invalid_hmtx (void)
   hb_set_add (codepoints, 'b');
   hb_set_add (codepoints, 'c');
 
-  hb_subset_profile_t *profile = hb_subset_profile_create();
-  hb_face_t *subset = hb_subset (face, profile, input);
+  hb_face_t *subset = hb_subset (face, input);
   g_assert (subset);
   g_assert (subset == hb_face_get_empty ());
 
   hb_subset_input_destroy (input);
-  hb_subset_profile_destroy (profile);
   hb_face_destroy (subset);
   hb_face_destroy (face);
 }
diff --git a/test/api/test-subset.c b/test/api/test-subset.c
index 6d2bf06e..b0a3446c 100644
--- a/test/api/test-subset.c
+++ b/test/api/test-subset.c
@@ -40,13 +40,11 @@ test_subset_32_tables (void)
   hb_set_add (codepoints, 'b');
   hb_set_add (codepoints, 'c');
 
-  hb_subset_profile_t *profile = hb_subset_profile_create();
-  hb_face_t *subset = hb_subset (face, profile, input);
+  hb_face_t *subset = hb_subset (face, input);
   g_assert (subset);
   g_assert (subset != hb_face_get_empty ());
 
   hb_subset_input_destroy (input);
-  hb_subset_profile_destroy (profile);
   hb_face_destroy (subset);
   hb_face_destroy (face);
 }
@@ -62,13 +60,11 @@ test_subset_no_inf_loop (void)
   hb_set_add (codepoints, 'b');
   hb_set_add (codepoints, 'c');
 
-  hb_subset_profile_t *profile = hb_subset_profile_create();
-  hb_face_t *subset = hb_subset (face, profile, input);
+  hb_face_t *subset = hb_subset (face, input);
   g_assert (subset);
   g_assert (subset == hb_face_get_empty ());
 
   hb_subset_input_destroy (input);
-  hb_subset_profile_destroy (profile);
   hb_face_destroy (subset);
   hb_face_destroy (face);
 }
@@ -84,13 +80,11 @@ test_subset_crash (void)
   hb_set_add (codepoints, 'b');
   hb_set_add (codepoints, 'c');
 
-  hb_subset_profile_t *profile = hb_subset_profile_create();
-  hb_face_t *subset = hb_subset (face, profile, input);
+  hb_face_t *subset = hb_subset (face, input);
   g_assert (subset);
   g_assert (subset == hb_face_get_empty ());
 
   hb_subset_input_destroy (input);
-  hb_subset_profile_destroy (profile);
   hb_face_destroy (subset);
   hb_face_destroy (face);
 }
diff --git a/test/fuzzing/hb-subset-fuzzer.cc b/test/fuzzing/hb-subset-fuzzer.cc
index 28ce921c..108f6ec1 100644
--- a/test/fuzzing/hb-subset-fuzzer.cc
+++ b/test/fuzzing/hb-subset-fuzzer.cc
@@ -12,8 +12,6 @@ void trySubset (hb_face_t *face,
                 bool drop_hints,
                 bool drop_ot_layout)
 {
-  hb_subset_profile_t *profile = hb_subset_profile_create ();
-
   hb_subset_input_t *input = hb_subset_input_create_or_fail ();
   *hb_subset_input_drop_hints (input) = drop_hints;
   *hb_subset_input_drop_ot_layout (input) = drop_ot_layout;
@@ -24,11 +22,10 @@ void trySubset (hb_face_t *face,
     hb_set_add (codepoints, text[i]);
   }
 
-  hb_face_t *result = hb_subset (face, profile, input);
+  hb_face_t *result = hb_subset (face, input);
   hb_face_destroy (result);
 
   hb_subset_input_destroy (input);
-  hb_subset_profile_destroy (profile);
 }
 
 void trySubset (hb_face_t *face,
diff --git a/util/hb-subset.cc b/util/hb-subset.cc
index a15495fa..f333be8a 100644
--- a/util/hb-subset.cc
+++ b/util/hb-subset.cc
@@ -92,17 +92,15 @@ struct subset_consumer_t
   {
     input->drop_hints = subset_options.drop_hints;
 
-    hb_subset_profile_t *subset_profile = hb_subset_profile_create();
     hb_face_t *face = hb_font_get_face (font);
 
-    hb_face_t *new_face = hb_subset(face, subset_profile, input);
+    hb_face_t *new_face = hb_subset(face, input);
     hb_blob_t *result = hb_face_reference_blob (new_face);
 
     failed = !hb_blob_get_length (result);
     if (!failed)
       write_file (options.output_file, result);
 
-    hb_subset_profile_destroy (subset_profile);
     hb_subset_input_destroy (input);
     hb_blob_destroy (result);
     hb_face_destroy (new_face);


More information about the HarfBuzz mailing list