diff --git a/src/dump-emoji.cc b/src/dump-emoji.cc index 400b890ad..65214692f 100644 --- a/src/dump-emoji.cc +++ b/src/dump-emoji.cc @@ -233,10 +233,10 @@ int main (int argc, char **argv) svg.dump (svg_callback); svg.fini (); - hb_blob_t* colr_blob = OT::hb_sanitize_context_t().reference_table (face); + hb_blob_t* colr_blob = hb_sanitize_context_t ().reference_table (face); const OT::COLR *colr = colr_blob->as (); - hb_blob_t* cpal_blob = OT::hb_sanitize_context_t().reference_table (face); + hb_blob_t* cpal_blob = hb_sanitize_context_t ().reference_table (face); const OT::CPAL *cpal = cpal_blob->as (); cairo_font_face_t *cairo_face; diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc index 405aafccb..3417033fa 100644 --- a/src/hb-aat-layout.cc +++ b/src/hb-aat-layout.cc @@ -61,7 +61,7 @@ _get_morx (hb_face_t *face, hb_blob_t **blob = nullptr) // static inline void // _hb_aat_layout_create (hb_face_t *face) // { -// hb_blob_t *morx_blob = OT::hb_sanitize_context_t().reference_table (face); +// hb_blob_t *morx_blob = hb_sanitize_context_t ().reference_table (face); // morx_blob->as (); // if (0) diff --git a/src/hb-face.cc b/src/hb-face.cc index 22b36a911..75dc486ea 100644 --- a/src/hb-face.cc +++ b/src/hb-face.cc @@ -52,7 +52,7 @@ hb_face_count (hb_blob_t *blob) /* TODO We shouldn't be sanitizing blob. Port to run sanitizer and return if not sane. */ /* Make API signature const after. */ - hb_blob_t *sanitized = OT::hb_sanitize_context_t().sanitize_blob (hb_blob_reference (blob)); + hb_blob_t *sanitized = hb_sanitize_context_t ().sanitize_blob (hb_blob_reference (blob)); const OT::OpenTypeFontFile& ot = *sanitized->as (); unsigned int ret = ot.get_face_count (); hb_blob_destroy (sanitized); @@ -190,7 +190,7 @@ hb_face_create (hb_blob_t *blob, if (unlikely (!blob)) blob = hb_blob_get_empty (); - hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (OT::hb_sanitize_context_t().sanitize_blob (hb_blob_reference (blob)), index); + hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (hb_sanitize_context_t ().sanitize_blob (hb_blob_reference (blob)), index); if (unlikely (!closure)) return hb_face_get_empty (); diff --git a/src/hb-machinery-private.hh b/src/hb-machinery-private.hh index 6617264b7..6328fb007 100644 --- a/src/hb-machinery-private.hh +++ b/src/hb-machinery-private.hh @@ -35,9 +35,6 @@ #include "hb-iter-private.hh" -namespace OT { - - /* * Casts */ @@ -593,7 +590,8 @@ struct BEInt * Lazy struct and blob loaders. */ -/* Logic is shared between hb_lazy_loader_t and hb_table_lazy_loader_t */ +/* Logic is shared between hb_lazy_loader_t and hb_table_lazy_loader_t. + * I mean, yeah, only every method is different. */ template struct hb_lazy_loader_t { @@ -643,7 +641,8 @@ struct hb_lazy_loader_t mutable T *instance; }; -/* Logic is shared between hb_lazy_loader_t and hb_table_lazy_loader_t */ +/* Logic is shared between hb_lazy_loader_t and hb_table_lazy_loader_t. + * I mean, yeah, only every method is different. */ template struct hb_table_lazy_loader_t { @@ -664,7 +663,7 @@ struct hb_table_lazy_loader_t hb_blob_t *b = (hb_blob_t *) hb_atomic_ptr_get (&blob); if (unlikely (!b)) { - b = OT::hb_sanitize_context_t().reference_table (face); + b = hb_sanitize_context_t ().reference_table (face); if (!hb_atomic_ptr_cmpexch (&blob, nullptr, b)) { hb_blob_destroy (b); @@ -692,7 +691,4 @@ struct hb_table_lazy_loader_t }; -} /* namespace OT */ - - #endif /* HB_MACHINERY_PRIVATE_HH */ diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 831023032..5085aa823 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -44,10 +44,10 @@ struct hb_ot_font_t OT::cmap::accelerator_t cmap; OT::hmtx::accelerator_t h_metrics; OT::vmtx::accelerator_t v_metrics; - OT::hb_lazy_loader_t glyf; - OT::hb_lazy_loader_t cbdt; - OT::hb_lazy_loader_t post; - OT::hb_lazy_loader_t kern; + hb_lazy_loader_t glyf; + hb_lazy_loader_t cbdt; + hb_lazy_loader_t post; + hb_lazy_loader_t kern; }; diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index 6fe673e91..a3cf137de 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -172,11 +172,11 @@ struct hb_ot_layout_t const struct OT::GPOS *gpos; /* TODO Move the following out of this struct. */ - OT::hb_table_lazy_loader_t base; - OT::hb_table_lazy_loader_t math; - OT::hb_table_lazy_loader_t fvar; - OT::hb_table_lazy_loader_t avar; - OT::hb_table_lazy_loader_t morx; + hb_table_lazy_loader_t base; + hb_table_lazy_loader_t math; + hb_table_lazy_loader_t fvar; + hb_table_lazy_loader_t avar; + hb_table_lazy_loader_t morx; unsigned int gsub_lookup_count; unsigned int gpos_lookup_count; diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index c790c3ceb..4cf469c3d 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -54,13 +54,13 @@ _hb_ot_layout_create (hb_face_t *face) if (unlikely (!layout)) return nullptr; - layout->gdef_blob = OT::hb_sanitize_context_t().reference_table (face); + layout->gdef_blob = hb_sanitize_context_t ().reference_table (face); layout->gdef = layout->gdef_blob->as (); - layout->gsub_blob = OT::hb_sanitize_context_t().reference_table (face); + layout->gsub_blob = hb_sanitize_context_t ().reference_table (face); layout->gsub = layout->gsub_blob->as (); - layout->gpos_blob = OT::hb_sanitize_context_t().reference_table (face); + layout->gpos_blob = hb_sanitize_context_t ().reference_table (face); layout->gpos = layout->gpos_blob->as (); layout->math.init (face); @@ -1116,7 +1116,7 @@ struct GPOSProxy struct hb_get_subtables_context_t : - OT::hb_dispatch_context_t + hb_dispatch_context_t { template static inline bool apply_to (const void *obj, OT::hb_ot_apply_context_t *c) diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh index 5a257f042..40c5015c9 100644 --- a/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/src/hb-ot-shape-complex-arabic-fallback.hh @@ -79,12 +79,12 @@ arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan HB_UNUS * May not be good-enough for presidential candidate interviews, but good-enough for us... */ hb_stable_sort (&glyphs[0], num_glyphs, (int(*)(const OT::GlyphID*, const OT::GlyphID *)) OT::GlyphID::cmp, &substitutes[0]); - OT::Supplier glyphs_supplier (glyphs, num_glyphs); - OT::Supplier substitutes_supplier (substitutes, num_glyphs); + Supplier glyphs_supplier (glyphs, num_glyphs); + Supplier substitutes_supplier (substitutes, num_glyphs); /* Each glyph takes four bytes max, and there's some overhead. */ char buf[(SHAPING_TABLE_LAST - SHAPING_TABLE_FIRST + 1) * 4 + 128]; - OT::hb_serialize_context_t c (buf, sizeof (buf)); + hb_serialize_context_t c (buf, sizeof (buf)); OT::SubstLookup *lookup = c.start_serialize (); bool ret = lookup->serialize_single (&c, OT::LookupFlag::IgnoreMarks, @@ -155,15 +155,15 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN if (!num_ligatures) return nullptr; - OT::Supplier first_glyphs_supplier (first_glyphs, num_first_glyphs); - OT::Supplier ligature_per_first_glyph_count_supplier (ligature_per_first_glyph_count_list, num_first_glyphs); - OT::Supplier ligatures_supplier (ligature_list, num_ligatures); - OT::Supplier component_count_supplier (component_count_list, num_ligatures); - OT::Supplier component_supplier (component_list, num_ligatures); + Supplier first_glyphs_supplier (first_glyphs, num_first_glyphs); + Supplier ligature_per_first_glyph_count_supplier (ligature_per_first_glyph_count_list, num_first_glyphs); + Supplier ligatures_supplier (ligature_list, num_ligatures); + Supplier component_count_supplier (component_count_list, num_ligatures); + Supplier component_supplier (component_list, num_ligatures); /* 16 bytes per ligature ought to be enough... */ char buf[ARRAY_LENGTH_CONST (ligature_list) * 16 + 128]; - OT::hb_serialize_context_t c (buf, sizeof (buf)); + hb_serialize_context_t c (buf, sizeof (buf)); OT::SubstLookup *lookup = c.start_serialize (); bool ret = lookup->serialize_ligature (&c, OT::LookupFlag::IgnoreMarks, diff --git a/src/hb-static.cc b/src/hb-static.cc index e6920e7e0..bd0943f53 100644 --- a/src/hb-static.cc +++ b/src/hb-static.cc @@ -38,7 +38,7 @@ hb_vector_size_impl_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_ void hb_face_t::load_num_glyphs (void) const { - OT::hb_sanitize_context_t c = OT::hb_sanitize_context_t(); + hb_sanitize_context_t c = hb_sanitize_context_t (); c.set_num_glyphs (0); /* So we don't recurse ad infinitum. */ hb_blob_t *maxp_blob = c.reference_table (this); const OT::maxp *maxp_table = maxp_blob->as (); @@ -49,7 +49,7 @@ hb_face_t::load_num_glyphs (void) const void hb_face_t::load_upem (void) const { - hb_blob_t *head_blob = OT::hb_sanitize_context_t().reference_table (this); + hb_blob_t *head_blob = hb_sanitize_context_t ().reference_table (this); const OT::head *head_table = head_blob->as (); upem = head_table->get_upem (); hb_blob_destroy (head_blob); diff --git a/src/hb-subset-glyf.cc b/src/hb-subset-glyf.cc index 2b97a010a..36af3beae 100644 --- a/src/hb-subset-glyf.cc +++ b/src/hb-subset-glyf.cc @@ -292,7 +292,7 @@ hb_subset_glyf_and_loca (hb_subset_plan_t *plan, hb_blob_t **glyf_prime, /* OUT */ hb_blob_t **loca_prime /* OUT */) { - hb_blob_t *glyf_blob = OT::hb_sanitize_context_t().reference_table (plan->source); + hb_blob_t *glyf_blob = hb_sanitize_context_t ().reference_table (plan->source); const char *glyf_data = hb_blob_get_data(glyf_blob, nullptr); OT::glyf::accelerator_t glyf; diff --git a/src/hb-subset.cc b/src/hb-subset.cc index 308c7eb21..9e8e2aff7 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -78,7 +78,7 @@ template static bool _subset (hb_subset_plan_t *plan) { - hb_blob_t *source_blob = OT::hb_sanitize_context_t().reference_table (plan->source); + hb_blob_t *source_blob = hb_sanitize_context_t ().reference_table (plan->source); const TableType *table = source_blob->as (); hb_tag_t tag = TableType::tableTag; @@ -157,14 +157,14 @@ _hb_subset_face_data_reference_blob (hb_subset_face_data_t *data) if (unlikely (!buf)) return nullptr; - OT::hb_serialize_context_t c (buf, face_length); + hb_serialize_context_t c (buf, face_length); OT::OpenTypeFontFile *f = c.start_serialize (); bool is_cff = data->tables.lsearch (HB_TAG ('C','F','F',' ')) || data->tables.lsearch (HB_TAG ('C','F','F','2')); hb_tag_t sfnt_tag = is_cff ? OT::OpenTypeFontFile::CFFTag : OT::OpenTypeFontFile::TrueTypeTag; - OT::Supplier tags_supplier (&data->tables[0].tag, table_count, sizeof (data->tables[0])); - OT::Supplier blobs_supplier (&data->tables[0].blob, table_count, sizeof (data->tables[0])); + Supplier tags_supplier (&data->tables[0].tag, table_count, sizeof (data->tables[0])); + Supplier blobs_supplier (&data->tables[0].blob, table_count, sizeof (data->tables[0])); bool ret = f->serialize_single (&c, sfnt_tag, tags_supplier, diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index c835c75da..7f7f10d0b 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -358,7 +358,7 @@ _hb_rename_font (hb_blob_t *blob, wchar_t *new_name) * full, PS. All of them point to the same name data with our unique name. */ - blob = OT::hb_sanitize_context_t().sanitize_blob (blob); + blob = hb_sanitize_context_t ().sanitize_blob (blob); unsigned int length, new_length, name_str_len; const char *orig_sfnt_data = hb_blob_get_data (blob, &length);