From e0ac6c587bc5099d67c5026355f8acf62c1955a0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 2 Feb 2022 18:57:12 -0600 Subject: [PATCH] Remove remaining traces of HB_EXPERIMENTAL_API --- .github/workflows/coverity-scan.yml | 2 +- meson.build | 5 ----- perf/perf.cc | 2 -- src/harfbuzz.cc | 1 + test/api/test-ot-face.c | 2 -- test/api/test-var-coords.c | 2 -- test/fuzzing/hb-draw-fuzzer.cc | 8 -------- 7 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index 6fcb4e5ef..b53d83cf2 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -21,7 +21,7 @@ jobs: TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} # 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 diff --git a/meson.build b/meson.build index 3e64cba2d..2531ef0ec 100644 --- a/meson.build +++ b/meson.build @@ -208,10 +208,6 @@ if get_option('icu_builtin') conf.set('HAVE_ICU_BUILTIN', 1) endif -if get_option('experimental_api') - conf.set('HB_EXPERIMENTAL_API', 1) -endif - if freetype_dep.found() conf.set('HAVE_FREETYPE', 1) check_freetype_funcs = [ @@ -392,7 +388,6 @@ build_summary = { {'Documentation': conf.get('HAVE_GTK_DOC', 0) == 1, 'GObject bindings': conf.get('HAVE_GOBJECT', 0) == 1, 'Introspection': conf.get('HAVE_INTROSPECTION', 0) == 1, - 'Experimental APIs': conf.get('HB_EXPERIMENTAL_API', 0) == 1, }, 'Testing': {'Tests': get_option('tests').enabled(), diff --git a/perf/perf.cc b/perf/perf.cc index a364b910b..2b7a4525d 100644 --- a/perf/perf.cc +++ b/perf/perf.cc @@ -8,9 +8,7 @@ #ifdef HAVE_FREETYPE enum backend_t { HARFBUZZ, FREETYPE, TTF_PARSER }; #include "perf-extents.hh" -#ifdef HB_EXPERIMENTAL_API #include "perf-draw.hh" #endif -#endif BENCHMARK_MAIN (); diff --git a/src/harfbuzz.cc b/src/harfbuzz.cc index b6a5957c4..d8d9bcd06 100644 --- a/src/harfbuzz.cc +++ b/src/harfbuzz.cc @@ -5,6 +5,7 @@ #include "hb-buffer-verify.cc" #include "hb-buffer.cc" #include "hb-common.cc" +#include "hb-draw-glyph.cc" #include "hb-draw.cc" #include "hb-face.cc" #include "hb-fallback-shape.cc" diff --git a/test/api/test-ot-face.c b/test/api/test-ot-face.c index e5c9b861a..e00a29776 100644 --- a/test/api/test-ot-face.c +++ b/test/api/test-ot-face.c @@ -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_coords (face, 0, NULL, NULL); -#ifdef HB_EXPERIMENTAL_API hb_draw_funcs_t *funcs = hb_draw_funcs_create (); hb_font_draw_glyph (font, cp, funcs, NULL); hb_draw_funcs_destroy (funcs); -#endif hb_set_destroy (set); diff --git a/test/api/test-var-coords.c b/test/api/test-var-coords.c index aa152e3ed..490e5fc06 100644 --- a/test/api/test-var-coords.c +++ b/test/api/test-var-coords.c @@ -31,7 +31,6 @@ static void test_get_var_coords (void) { -#ifdef HB_EXPERIMENTAL_API #ifndef G_APPROX_VALUE #define G_APPROX_VALUE(a, b, epsilon) \ (((a) > (b) ? (a) - (b) : (b) - (a)) < (epsilon)) @@ -66,7 +65,6 @@ test_get_var_coords (void) hb_font_destroy (font); hb_face_destroy (face); -#endif } static void diff --git a/test/fuzzing/hb-draw-fuzzer.cc b/test/fuzzing/hb-draw-fuzzer.cc index 772a35831..3c0ae02b5 100644 --- a/test/fuzzing/hb-draw-fuzzer.cc +++ b/test/fuzzing/hb-draw-fuzzer.cc @@ -5,7 +5,6 @@ #include "hb-fuzzer.hh" -#ifdef HB_EXPERIMENTAL_API struct _user_data_t { bool is_open; @@ -75,7 +74,6 @@ _close_path (void *user_data_) assert (user_data->path_start_x == user_data->path_last_x && user_data->path_start_y == user_data->path_last_y); } -#endif /* 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) @@ -135,7 +133,6 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) unsigned glyph_count = hb_face_get_glyph_count (face); glyph_count = glyph_count > 16 ? 16 : glyph_count; -#ifdef HB_EXPERIMENTAL_API _user_data_t user_data = {false, 0, 0, 0, 0, 0}; 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_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); -#endif volatile unsigned counter = !glyph_count; hb_set_t *set = hb_set_create (); for (unsigned gid = 0; gid < glyph_count; ++gid) { -#ifdef HB_EXPERIMENTAL_API hb_font_draw_glyph (font, gid, funcs, &user_data); assert (!user_data.is_open); -#endif /* Glyph extents also may practices the similar path, call it now that is related */ hb_glyph_extents_t extents; @@ -166,9 +160,7 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) } hb_set_destroy (set); assert (counter); -#ifdef HB_EXPERIMENTAL_API hb_draw_funcs_destroy (funcs); -#endif hb_font_destroy (font); hb_face_destroy (face);