提交 466b3e58 编写于 作者: B Behdad Esfahbod

Shuffle things around a bit

上级 fc8189b6
...@@ -69,8 +69,8 @@ hb_coretext_face_create (CGFontRef cg_font) ...@@ -69,8 +69,8 @@ hb_coretext_face_create (CGFontRef cg_font)
} }
HB_SHAPER_DATA_ENSURE_DECLARE(coretext, face) HB_SHAPER_DATA_ENSURE_DEFINE(coretext, face)
HB_SHAPER_DATA_ENSURE_DECLARE(coretext, font) HB_SHAPER_DATA_ENSURE_DEFINE(coretext, font)
/* /*
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#define HB_DEBUG_DIRECTWRITE (HB_DEBUG+0) #define HB_DEBUG_DIRECTWRITE (HB_DEBUG+0)
#endif #endif
HB_SHAPER_DATA_ENSURE_DECLARE(directwrite, face) HB_SHAPER_DATA_ENSURE_DEFINE(directwrite, face)
HB_SHAPER_DATA_ENSURE_DECLARE(directwrite, font) HB_SHAPER_DATA_ENSURE_DEFINE(directwrite, font)
/* /*
......
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
#include "hb-shaper-impl-private.hh" #include "hb-shaper-impl-private.hh"
HB_SHAPER_DATA_ENSURE_DEFINE(fallback, face)
HB_SHAPER_DATA_ENSURE_DEFINE(fallback, font)
/* /*
* shaper face data * shaper face data
*/ */
......
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
#include <graphite2/Segment.h> #include <graphite2/Segment.h>
HB_SHAPER_DATA_ENSURE_DECLARE(graphite2, face) HB_SHAPER_DATA_ENSURE_DEFINE(graphite2, face)
HB_SHAPER_DATA_ENSURE_DECLARE(graphite2, font) HB_SHAPER_DATA_ENSURE_DEFINE(graphite2, font)
/* /*
......
...@@ -623,5 +623,4 @@ _hb_buffer_assert_gsubgpos_vars (hb_buffer_t *buffer) ...@@ -623,5 +623,4 @@ _hb_buffer_assert_gsubgpos_vars (hb_buffer_t *buffer)
#undef lig_props #undef lig_props
#undef glyph_props #undef glyph_props
#endif /* HB_OT_LAYOUT_PRIVATE_HH */ #endif /* HB_OT_LAYOUT_PRIVATE_HH */
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
#include "hb-ot-map-private.hh" #include "hb-ot-map-private.hh"
HB_SHAPER_DATA_ENSURE_DECLARE(ot, face)
hb_ot_layout_t * hb_ot_layout_t *
_hb_ot_layout_create (hb_face_t *face) _hb_ot_layout_create (hb_face_t *face)
{ {
......
...@@ -26,10 +26,9 @@ ...@@ -26,10 +26,9 @@
#include "hb-open-type-private.hh" #include "hb-open-type-private.hh"
#include "hb-ot-layout-private.hh"
#include "hb-ot-math-table.hh" #include "hb-ot-math-table.hh"
HB_SHAPER_DATA_ENSURE_DECLARE(ot, face)
static inline const OT::MATH& static inline const OT::MATH&
_get_math (hb_face_t *face) _get_math (hb_face_t *face)
{ {
......
...@@ -128,6 +128,8 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, ...@@ -128,6 +128,8 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
* shaper face data * shaper face data
*/ */
HB_SHAPER_DATA_ENSURE_DEFINE(ot, face)
hb_ot_shaper_face_data_t * hb_ot_shaper_face_data_t *
_hb_ot_shaper_face_data_create (hb_face_t *face) _hb_ot_shaper_face_data_create (hb_face_t *face)
{ {
...@@ -145,6 +147,8 @@ _hb_ot_shaper_face_data_destroy (hb_ot_shaper_face_data_t *data) ...@@ -145,6 +147,8 @@ _hb_ot_shaper_face_data_destroy (hb_ot_shaper_face_data_t *data)
* shaper font data * shaper font data
*/ */
HB_SHAPER_DATA_ENSURE_DEFINE(ot, font)
struct hb_ot_shaper_font_data_t {}; struct hb_ot_shaper_font_data_t {};
hb_ot_shaper_font_data_t * hb_ot_shaper_font_data_t *
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "hb-ot-var-mvar-table.hh" #include "hb-ot-var-mvar-table.hh"
#include "hb-ot-var.h" #include "hb-ot-var.h"
HB_SHAPER_DATA_ENSURE_DECLARE(ot, face)
/* /*
* fvar/avar * fvar/avar
*/ */
......
...@@ -35,13 +35,6 @@ ...@@ -35,13 +35,6 @@
#endif #endif
#define HB_SHAPER_IMPLEMENT(shaper) \
HB_SHAPER_DATA_ENSURE_DECLARE(shaper, face) \
HB_SHAPER_DATA_ENSURE_DECLARE(shaper, font)
#include "hb-shaper-list.hh"
#undef HB_SHAPER_IMPLEMENT
static void static void
hb_shape_plan_plan (hb_shape_plan_t *shape_plan, hb_shape_plan_plan (hb_shape_plan_t *shape_plan,
const hb_feature_t *user_features, const hb_feature_t *user_features,
......
...@@ -71,22 +71,25 @@ struct hb_shaper_data_t { ...@@ -71,22 +71,25 @@ struct hb_shaper_data_t {
#define HB_SHAPER_DATA(shaper, object) HB_SHAPER_DATA_INSTANCE(shaper, object, object) #define HB_SHAPER_DATA(shaper, object) HB_SHAPER_DATA_INSTANCE(shaper, object, object)
#define HB_SHAPER_DATA_CREATE_FUNC(shaper, object) _hb_##shaper##_shaper_##object##_data_create #define HB_SHAPER_DATA_CREATE_FUNC(shaper, object) _hb_##shaper##_shaper_##object##_data_create
#define HB_SHAPER_DATA_DESTROY_FUNC(shaper, object) _hb_##shaper##_shaper_##object##_data_destroy #define HB_SHAPER_DATA_DESTROY_FUNC(shaper, object) _hb_##shaper##_shaper_##object##_data_destroy
#define HB_SHAPER_DATA_ENSURE_FUNC(shaper, object) hb_##shaper##_shaper_##object##_data_ensure
#define HB_SHAPER_DATA_PROTOTYPE(shaper, object) \ #define HB_SHAPER_DATA_PROTOTYPE(shaper, object) \
HB_SHAPER_DATA_TYPE (shaper, object); /* Type forward declaration. */ \ HB_SHAPER_DATA_TYPE (shaper, object); /* Type forward declaration. */ \
extern "C" HB_INTERNAL HB_SHAPER_DATA_TYPE (shaper, object) * \ extern "C" HB_INTERNAL HB_SHAPER_DATA_TYPE (shaper, object) * \
HB_SHAPER_DATA_CREATE_FUNC (shaper, object) (hb_##object##_t *object HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS); \ HB_SHAPER_DATA_CREATE_FUNC (shaper, object) (hb_##object##_t *object HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS); \
extern "C" HB_INTERNAL void \ extern "C" HB_INTERNAL void \
HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (HB_SHAPER_DATA_TYPE (shaper, object) *data) HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (HB_SHAPER_DATA_TYPE (shaper, object) *data); \
extern "C" HB_INTERNAL bool \
HB_SHAPER_DATA_ENSURE_FUNC (shaper, object) (hb_##object##_t *object)
#define HB_SHAPER_DATA_DESTROY(shaper, object) \ #define HB_SHAPER_DATA_DESTROY(shaper, object) \
if (HB_SHAPER_DATA_TYPE (shaper, object) *data = HB_SHAPER_DATA (shaper, object)) \ if (HB_SHAPER_DATA_TYPE (shaper, object) *data = HB_SHAPER_DATA (shaper, object)) \
if (data != HB_SHAPER_DATA_INVALID && data != HB_SHAPER_DATA_SUCCEEDED) \ if (data != HB_SHAPER_DATA_INVALID && data != HB_SHAPER_DATA_SUCCEEDED) \
HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (data); HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (data);
#define HB_SHAPER_DATA_ENSURE_DECLARE(shaper, object) \ #define HB_SHAPER_DATA_ENSURE_DEFINE(shaper, object) \
static inline bool \ bool \
hb_##shaper##_shaper_##object##_data_ensure (hb_##object##_t *object) \ HB_SHAPER_DATA_ENSURE_FUNC(shaper, object) (hb_##object##_t *object) \
{\ {\
retry: \ retry: \
HB_SHAPER_DATA_TYPE (shaper, object) *data = (HB_SHAPER_DATA_TYPE (shaper, object) *) hb_atomic_ptr_get (&HB_SHAPER_DATA (shaper, object)); \ HB_SHAPER_DATA_TYPE (shaper, object) *data = (HB_SHAPER_DATA_TYPE (shaper, object) *) hb_atomic_ptr_get (&HB_SHAPER_DATA (shaper, object)); \
......
...@@ -293,8 +293,8 @@ struct range_record_t { ...@@ -293,8 +293,8 @@ struct range_record_t {
unsigned int index_last; /* == end - 1 */ unsigned int index_last; /* == end - 1 */
}; };
HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, face) HB_SHAPER_DATA_ENSURE_DEFINE(uniscribe, face)
HB_SHAPER_DATA_ENSURE_DECLARE(uniscribe, font) HB_SHAPER_DATA_ENSURE_DEFINE(uniscribe, font)
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册