return Null(AAT::morx);
}
hb_ot_layout_t * layout = hb_ot_layout_from_face (face);
- const AAT::morx& morx = *(layout->morx.get ());
+ const AAT::morx& morx = *(layout->table.morx.get ());
if (blob)
- *blob = layout->morx.get_blob ();
+ *blob = layout->table.morx.get_blob ();
return morx;
}
struct hb_shaper_data_t shaper_data; /* Various shaper data. */
- /* Various non-shaping data. */
- /* ... */
-
/* Cache */
- struct plan_node_t {
+ struct plan_node_t
+ {
hb_shape_plan_t *shape_plan;
plan_node_t *next;
} *shape_plans;
-
inline hb_blob_t *reference_table (hb_tag_t tag) const
{
hb_blob_t *blob;
inline const Subclass* thiz (void) const { return static_cast<const Subclass *> (this); }
inline Subclass* thiz (void) { return static_cast<Subclass *> (this); }
+ inline void init0 (void) {} /* Init, when memory is already set to 0. No-op for us. */
inline void init (void)
{
instance = nullptr;
hb_ot_layout_lookup_accelerator_t *gsub_accels;
hb_ot_layout_lookup_accelerator_t *gpos_accels;
- /* TODO Move the following out of this struct. */
- hb_face_t *face; /* MUST be JUST before the lazy loaders. */
- hb_table_lazy_loader_t<1, struct OT::MATH> math;
- hb_table_lazy_loader_t<2, struct OT::fvar> fvar;
- hb_table_lazy_loader_t<3, struct OT::avar> avar;
- hb_table_lazy_loader_t<4, struct AAT::morx> morx;
+ /* Various non-shaping tables. */
+ struct tables_t
+ {
+ hb_face_t *face; /* MUST be JUST before the lazy loaders. */
+ hb_table_lazy_loader_t<1, struct OT::MATH> math;
+ hb_table_lazy_loader_t<2, struct OT::fvar> fvar;
+ hb_table_lazy_loader_t<3, struct OT::avar> avar;
+ hb_table_lazy_loader_t<4, struct AAT::morx> morx;
+ } table;
};
#include "hb-open-type-private.hh"
#include "hb-ot-layout-private.hh"
#include "hb-ot-map-private.hh"
+#include "hb-map-private.hh"
#include "hb-ot-layout-gdef-table.hh"
#include "hb-ot-layout-gsub-table.hh"
#include "hb-ot-color-sbix-table.hh"
#include "hb-ot-color-svg-table.hh"
#include "hb-ot-name-table.hh"
-#include "hb-map-private.hh"
static bool
layout->gpos_blob = hb_sanitize_context_t ().reference_table<OT::GPOS> (face);
layout->gpos = layout->gpos_blob->as<OT::GPOS> ();
- layout->face = face;
- layout->math.init ();
- layout->fvar.init ();
- layout->avar.init ();
- layout->morx.init ();
+ layout->table.face = face;
+ layout->table.math.init0 ();
+ layout->table.fvar.init0 ();
+ layout->table.avar.init0 ();
+ layout->table.morx.init0 ();
if (_hb_ot_blacklist_gdef (layout->gdef_blob->length,
layout->gsub_blob->length,
hb_blob_destroy (layout->gsub_blob);
hb_blob_destroy (layout->gpos_blob);
- layout->math.fini ();
- layout->fvar.fini ();
- layout->avar.fini ();
- layout->morx.fini ();
+ layout->table.math.fini ();
+ layout->table.fvar.fini ();
+ layout->table.avar.fini ();
+ layout->table.morx.fini ();
free (layout);
}
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::MATH);
hb_ot_layout_t * layout = hb_ot_layout_from_face (face);
- return *(layout->math.get ());
+ return *(layout->table.math.get ());
}
/*
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::fvar);
hb_ot_layout_t * layout = hb_ot_layout_from_face (face);
- return *(layout->fvar.get ());
+ return *(layout->table.fvar.get ());
}
static inline const OT::avar&
_get_avar (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::avar);
hb_ot_layout_t * layout = hb_ot_layout_from_face (face);
- return *(layout->avar.get ());
+ return *(layout->table.avar.get ());
}
/**