Imported Upstream version 8.2.2
[platform/upstream/harfbuzz.git] / src / hb-subset.hh
index 45cb763..4f192aa 100644 (file)
@@ -33,6 +33,7 @@
 #include "hb-subset.h"
 
 #include "hb-machinery.hh"
+#include "hb-serialize.hh"
 #include "hb-subset-input.hh"
 #include "hb-subset-plan.hh"
 
@@ -40,19 +41,33 @@ struct hb_subset_context_t :
        hb_dispatch_context_t<hb_subset_context_t, bool, HB_DEBUG_SUBSET>
 {
   const char *get_name () { return "SUBSET"; }
-  template <typename T>
-  bool dispatch (const T &obj) { return obj.subset (this); }
-  static bool default_return_value () { return true; }
+  static return_t default_return_value () { return true; }
 
+  private:
+  template <typename T, typename ...Ts> auto
+  _dispatch (const T &obj, hb_priority<1>, Ts&&... ds) HB_AUTO_RETURN
+  ( obj.subset (this, std::forward<Ts> (ds)...) )
+  template <typename T, typename ...Ts> auto
+  _dispatch (const T &obj, hb_priority<0>, Ts&&... ds) HB_AUTO_RETURN
+  ( obj.dispatch (this, std::forward<Ts> (ds)...) )
+  public:
+  template <typename T, typename ...Ts> auto
+  dispatch (const T &obj, Ts&&... ds) HB_AUTO_RETURN
+  ( _dispatch (obj, hb_prioritize, std::forward<Ts> (ds)...) )
+
+  hb_blob_t *source_blob;
   hb_subset_plan_t *plan;
   hb_serialize_context_t *serializer;
-  unsigned int debug_depth;
+  hb_tag_t table_tag;
 
-  hb_subset_context_t (hb_subset_plan_t *plan_,
-                      hb_serialize_context_t *serializer_) :
+  hb_subset_context_t (hb_blob_t *source_blob_,
+                      hb_subset_plan_t *plan_,
+                      hb_serialize_context_t *serializer_,
+                      hb_tag_t table_tag_) :
+                       source_blob (source_blob_),
                        plan (plan_),
                        serializer (serializer_),
-                       debug_depth (0) {}
+                       table_tag (table_tag_) {}
 };