< prev index next >

src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-common-private.hh

Print this page

        

@@ -27,10 +27,12 @@
  */
 
 #ifndef HB_OT_LAYOUT_COMMON_PRIVATE_HH
 #define HB_OT_LAYOUT_COMMON_PRIVATE_HH
 
+#include "hb-private.hh"
+#include "hb-debug.hh"
 #include "hb-ot-layout-private.hh"
 #include "hb-open-type-private.hh"
 #include "hb-set-private.hh"
 
 

@@ -43,16 +45,10 @@
 
 
 namespace OT {
 
 
-#define TRACE_DISPATCH(this, format) \
-        hb_auto_trace_t<context_t::max_debug_depth, typename context_t::return_t> trace \
-        (&c->debug_depth, c->get_name (), this, HB_FUNC, \
-         "format %d", (int) format);
-
-
 #define NOT_COVERED             ((unsigned int) -1)
 
 
 
 /*

@@ -212,11 +208,11 @@
       return Index::NOT_FOUND_INDEX;
    return reqFeatureIndex;;
   }
 
   inline bool sanitize (hb_sanitize_context_t *c,
-                        const Record<LangSys>::sanitize_closure_t * = NULL) const
+                        const Record<LangSys>::sanitize_closure_t * = nullptr) const
   {
     TRACE_SANITIZE (this);
     return_trace (c->check_struct (this) && featureIndex.sanitize (c));
   }
 

@@ -252,11 +248,11 @@
 
   inline bool has_default_lang_sys (void) const { return defaultLangSys != 0; }
   inline const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; }
 
   inline bool sanitize (hb_sanitize_context_t *c,
-                        const Record<Script>::sanitize_closure_t * = NULL) const
+                        const Record<Script>::sanitize_closure_t * = nullptr) const
   {
     TRACE_SANITIZE (this);
     return_trace (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this));
   }
 

@@ -433,21 +429,21 @@
   USHORT        format;                 /* Format number is set to 0. */
   USHORT        featUILableNameID;      /* The ‘name’ table name ID that
                                          * specifies a string (or strings,
                                          * for multiple languages) for a
                                          * user-interface label for this
-                                         * feature. (May be NULL.) */
+                                         * feature. (May be nullptr.) */
   USHORT        featUITooltipTextNameID;/* The ‘name’ table name ID that
                                          * specifies a string (or strings,
                                          * for multiple languages) that an
                                          * application can use for tooltip
                                          * text for this feature. (May be
-                                         * NULL.) */
+                                         * nullptr.) */
   USHORT        sampleTextNameID;       /* The ‘name’ table name ID that
                                          * specifies sample text that
                                          * illustrates the effect of this
-                                         * feature. (May be NULL.) */
+                                         * feature. (May be nullptr.) */
   USHORT        numNamedParameters;     /* Number of named parameters. (May
                                          * be zero.) */
   USHORT        firstParamUILabelNameID;/* The first ‘name’ table name ID
                                          * used to specify strings for
                                          * user-interface labels for the

@@ -505,11 +501,11 @@
 
   inline const FeatureParams &get_feature_params (void) const
   { return this+featureParams; }
 
   inline bool sanitize (hb_sanitize_context_t *c,
-                        const Record<Feature>::sanitize_closure_t *closure = NULL) const
+                        const Record<Feature>::sanitize_closure_t *closure = nullptr) const
   {
     TRACE_SANITIZE (this);
     if (unlikely (!(c->check_struct (this) && lookupIndex.sanitize (c))))
       return_trace (false);
 

@@ -688,11 +684,11 @@
 
   private:
   inline unsigned int get_coverage (hb_codepoint_t glyph_id) const
   {
     int i = glyphArray.bsearch (glyph_id);
-    ASSERT_STATIC (((unsigned int) -1) == NOT_COVERED);
+    static_assert ((((unsigned int) -1) == NOT_COVERED), "");
     return i;
   }
 
   inline bool serialize (hb_serialize_context_t *c,
                          Supplier<GlyphID> &glyphs,

@@ -939,11 +935,11 @@
     default:                                 break;
     }
   }
 
   struct Iter {
-    Iter (void) : format (0) {};
+    Iter (void) : format (0), u () {};
     inline void init (const Coverage &c_) {
       format = c_.u.format;
       switch (format) {
       case 1: u.format1.init (c_.u.format1); return;
       case 2: u.format2.init (c_.u.format2); return;

@@ -980,12 +976,12 @@
     }
 
     private:
     unsigned int format;
     union {
+    CoverageFormat2::Iter       format2; /* Put this one first since it's larger; helps shut up compiler. */
     CoverageFormat1::Iter       format1;
-    CoverageFormat2::Iter       format2;
     } u;
   };
 
   protected:
   union {

@@ -1321,10 +1317,18 @@
     return (this+dataSets[outer]).get_delta (inner,
                                              coords, coord_count,
                                              this+regions);
   }
 
+  inline float get_delta (unsigned int index,
+                          int *coords, unsigned int coord_count) const
+  {
+    unsigned int outer = index >> 16;
+    unsigned int inner = index & 0xFFFF;
+    return get_delta (outer, inner, coords, coord_count);
+  }
+
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
     return_trace (c->check_struct (this) &&
                   format == 1 &&

@@ -1332,11 +1336,11 @@
                   dataSets.sanitize (c, this));
   }
 
   protected:
   USHORT                                format;
-  OffsetTo<VarRegionList, ULONG>        regions;
+  LOffsetTo<VarRegionList>              regions;
   OffsetArrayOf<VarData, ULONG>         dataSets;
   public:
   DEFINE_SIZE_ARRAY (8, dataSets);
 };
 

@@ -1432,11 +1436,11 @@
     return_trace (c->check_struct (this) && feature.sanitize (c, base));
   }
 
   protected:
   USHORT                        featureIndex;
-  OffsetTo<Feature, ULONG>      feature;
+  LOffsetTo<Feature>    feature;
   public:
   DEFINE_SIZE_STATIC (6);
 };
 
 struct FeatureTableSubstitution

@@ -1448,11 +1452,11 @@
     {
       const FeatureTableSubstitutionRecord &record = substitutions.array[i];
       if (record.featureIndex == feature_index)
         return &(this+record.feature);
     }
-    return NULL;
+    return nullptr;
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);

@@ -1479,13 +1483,13 @@
     return_trace (conditions.sanitize (c, base) &&
                   substitutions.sanitize (c, base));
   }
 
   protected:
-  OffsetTo<ConditionSet, ULONG>
+  LOffsetTo<ConditionSet>
                         conditions;
-  OffsetTo<FeatureTableSubstitution, ULONG>
+  LOffsetTo<FeatureTableSubstitution>
                         substitutions;
   public:
   DEFINE_SIZE_STATIC (8);
 };
 

@@ -1525,11 +1529,11 @@
                   varRecords.sanitize (c, this));
   }
 
   protected:
   FixedVersion<>        version;        /* Version--0x00010000u */
-  ArrayOf<FeatureVariationRecord, ULONG>
+  LArrayOf<FeatureVariationRecord>
                         varRecords;
   public:
   DEFINE_SIZE_ARRAY (8, varRecords);
 };
 
< prev index next >