Remove remaining traces of HB_EXPERIMENTAL_API

This commit is contained in:
Behdad Esfahbod 2022-02-02 18:57:12 -06:00
parent 5207ce828a
commit e0ac6c587b
7 changed files with 2 additions and 20 deletions

View File

@ -21,7 +21,7 @@ jobs:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
# ideally we should've used meson and ninja here but it complains about coverage or something # ideally we should've used meson and ninja here but it complains about coverage or something
- run: cov-analysis-linux64/bin/cov-build --dir cov-int clang src/hb-*.cc -DHAVE_FREETYPE -DHAVE_GRAPHITE2 -DHAVE_GLIB -DHAVE_ICU `pkg-config --cflags freetype2 graphite2 glib-2.0 icu-uc` -DHAVE_ROUNDF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H -DHAVE_GETPAGESIZE -DHB_EXPERIMENTAL_API -c - run: cov-analysis-linux64/bin/cov-build --dir cov-int clang src/hb-*.cc -DHAVE_FREETYPE -DHAVE_GRAPHITE2 -DHAVE_GLIB -DHAVE_ICU `pkg-config --cflags freetype2 graphite2 glib-2.0 icu-uc` -DHAVE_ROUNDF -DHAVE_SYS_MMAN_H -DHAVE_UNISTD_H -DHAVE_GETPAGESIZE -c
- run: tar czvf harfbuzz.tgz cov-int - run: tar czvf harfbuzz.tgz cov-int

View File

@ -208,10 +208,6 @@ if get_option('icu_builtin')
conf.set('HAVE_ICU_BUILTIN', 1) conf.set('HAVE_ICU_BUILTIN', 1)
endif endif
if get_option('experimental_api')
conf.set('HB_EXPERIMENTAL_API', 1)
endif
if freetype_dep.found() if freetype_dep.found()
conf.set('HAVE_FREETYPE', 1) conf.set('HAVE_FREETYPE', 1)
check_freetype_funcs = [ check_freetype_funcs = [
@ -392,7 +388,6 @@ build_summary = {
{'Documentation': conf.get('HAVE_GTK_DOC', 0) == 1, {'Documentation': conf.get('HAVE_GTK_DOC', 0) == 1,
'GObject bindings': conf.get('HAVE_GOBJECT', 0) == 1, 'GObject bindings': conf.get('HAVE_GOBJECT', 0) == 1,
'Introspection': conf.get('HAVE_INTROSPECTION', 0) == 1, 'Introspection': conf.get('HAVE_INTROSPECTION', 0) == 1,
'Experimental APIs': conf.get('HB_EXPERIMENTAL_API', 0) == 1,
}, },
'Testing': 'Testing':
{'Tests': get_option('tests').enabled(), {'Tests': get_option('tests').enabled(),

View File

@ -8,9 +8,7 @@
#ifdef HAVE_FREETYPE #ifdef HAVE_FREETYPE
enum backend_t { HARFBUZZ, FREETYPE, TTF_PARSER }; enum backend_t { HARFBUZZ, FREETYPE, TTF_PARSER };
#include "perf-extents.hh" #include "perf-extents.hh"
#ifdef HB_EXPERIMENTAL_API
#include "perf-draw.hh" #include "perf-draw.hh"
#endif #endif
#endif
BENCHMARK_MAIN (); BENCHMARK_MAIN ();

View File

@ -5,6 +5,7 @@
#include "hb-buffer-verify.cc" #include "hb-buffer-verify.cc"
#include "hb-buffer.cc" #include "hb-buffer.cc"
#include "hb-common.cc" #include "hb-common.cc"
#include "hb-draw-glyph.cc"
#include "hb-draw.cc" #include "hb-draw.cc"
#include "hb-face.cc" #include "hb-face.cc"
#include "hb-fallback-shape.cc" #include "hb-fallback-shape.cc"

View File

@ -163,11 +163,9 @@ test_font (hb_font_t *font, hb_codepoint_t cp)
hb_ot_var_normalize_variations (face, NULL, 0, NULL, 0); hb_ot_var_normalize_variations (face, NULL, 0, NULL, 0);
hb_ot_var_normalize_coords (face, 0, NULL, NULL); hb_ot_var_normalize_coords (face, 0, NULL, NULL);
#ifdef HB_EXPERIMENTAL_API
hb_draw_funcs_t *funcs = hb_draw_funcs_create (); hb_draw_funcs_t *funcs = hb_draw_funcs_create ();
hb_font_draw_glyph (font, cp, funcs, NULL); hb_font_draw_glyph (font, cp, funcs, NULL);
hb_draw_funcs_destroy (funcs); hb_draw_funcs_destroy (funcs);
#endif
hb_set_destroy (set); hb_set_destroy (set);

View File

@ -31,7 +31,6 @@
static void static void
test_get_var_coords (void) test_get_var_coords (void)
{ {
#ifdef HB_EXPERIMENTAL_API
#ifndef G_APPROX_VALUE #ifndef G_APPROX_VALUE
#define G_APPROX_VALUE(a, b, epsilon) \ #define G_APPROX_VALUE(a, b, epsilon) \
(((a) > (b) ? (a) - (b) : (b) - (a)) < (epsilon)) (((a) > (b) ? (a) - (b) : (b) - (a)) < (epsilon))
@ -66,7 +65,6 @@ test_get_var_coords (void)
hb_font_destroy (font); hb_font_destroy (font);
hb_face_destroy (face); hb_face_destroy (face);
#endif
} }
static void static void

View File

@ -5,7 +5,6 @@
#include "hb-fuzzer.hh" #include "hb-fuzzer.hh"
#ifdef HB_EXPERIMENTAL_API
struct _user_data_t struct _user_data_t
{ {
bool is_open; bool is_open;
@ -75,7 +74,6 @@ _close_path (void *user_data_)
assert (user_data->path_start_x == user_data->path_last_x && assert (user_data->path_start_x == user_data->path_last_x &&
user_data->path_start_y == user_data->path_last_y); user_data->path_start_y == user_data->path_last_y);
} }
#endif
/* Similar to test-ot-face.c's #test_font() */ /* Similar to test-ot-face.c's #test_font() */
static void misc_calls_for_gid (hb_face_t *face, hb_font_t *font, hb_set_t *set, hb_codepoint_t cp) static void misc_calls_for_gid (hb_face_t *face, hb_font_t *font, hb_set_t *set, hb_codepoint_t cp)
@ -135,7 +133,6 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
unsigned glyph_count = hb_face_get_glyph_count (face); unsigned glyph_count = hb_face_get_glyph_count (face);
glyph_count = glyph_count > 16 ? 16 : glyph_count; glyph_count = glyph_count > 16 ? 16 : glyph_count;
#ifdef HB_EXPERIMENTAL_API
_user_data_t user_data = {false, 0, 0, 0, 0, 0}; _user_data_t user_data = {false, 0, 0, 0, 0, 0};
hb_draw_funcs_t *funcs = hb_draw_funcs_create (); hb_draw_funcs_t *funcs = hb_draw_funcs_create ();
@ -144,15 +141,12 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
hb_draw_funcs_set_quadratic_to_func (funcs, (hb_draw_quadratic_to_func_t) _quadratic_to); hb_draw_funcs_set_quadratic_to_func (funcs, (hb_draw_quadratic_to_func_t) _quadratic_to);
hb_draw_funcs_set_cubic_to_func (funcs, (hb_draw_cubic_to_func_t) _cubic_to); hb_draw_funcs_set_cubic_to_func (funcs, (hb_draw_cubic_to_func_t) _cubic_to);
hb_draw_funcs_set_close_path_func (funcs, (hb_draw_close_path_func_t) _close_path); hb_draw_funcs_set_close_path_func (funcs, (hb_draw_close_path_func_t) _close_path);
#endif
volatile unsigned counter = !glyph_count; volatile unsigned counter = !glyph_count;
hb_set_t *set = hb_set_create (); hb_set_t *set = hb_set_create ();
for (unsigned gid = 0; gid < glyph_count; ++gid) for (unsigned gid = 0; gid < glyph_count; ++gid)
{ {
#ifdef HB_EXPERIMENTAL_API
hb_font_draw_glyph (font, gid, funcs, &user_data); hb_font_draw_glyph (font, gid, funcs, &user_data);
assert (!user_data.is_open); assert (!user_data.is_open);
#endif
/* Glyph extents also may practices the similar path, call it now that is related */ /* Glyph extents also may practices the similar path, call it now that is related */
hb_glyph_extents_t extents; hb_glyph_extents_t extents;
@ -166,9 +160,7 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
} }
hb_set_destroy (set); hb_set_destroy (set);
assert (counter); assert (counter);
#ifdef HB_EXPERIMENTAL_API
hb_draw_funcs_destroy (funcs); hb_draw_funcs_destroy (funcs);
#endif
hb_font_destroy (font); hb_font_destroy (font);
hb_face_destroy (face); hb_face_destroy (face);