summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-12-25 15:01:17 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-12-25 15:01:17 +0000
commita042d311c8e6f5fbb82c52a24a47831674dff9e7 (patch)
tree7039f0cf449f6e3b098b09e7c949cbba3b8ec251
parent07c91f9b2f9f3979939d6d7adcd22968b9b5b33e (diff)
parent8fa7b37a31422c4334c6e93213ca5816644e8aa4 (diff)
downloadpango-a042d311c8e6f5fbb82c52a24a47831674dff9e7.tar.gz
Merge branch 'matthiasc/for-main' into 'main'
tracing: Fix the defines Closes #648 See merge request GNOME/pango!565
-rw-r--r--pango/itemize.c8
-rw-r--r--pango/meson.build1
-rw-r--r--pango/pango-trace-private.h4
-rw-r--r--pango/pangofc-fontmap.c24
-rw-r--r--tests/meson.build14
5 files changed, 40 insertions, 11 deletions
diff --git a/pango/itemize.c b/pango/itemize.c
index 9aa0c29c..442fe8e9 100644
--- a/pango/itemize.c
+++ b/pango/itemize.c
@@ -772,7 +772,8 @@ get_font (ItemizeState *state,
GetFontInfo info;
/* We'd need a separate cache when fallback is disabled, but since lookup
- * with fallback disabled is faster anyways, we just skip caching */
+ * with fallback disabled is faster anyways, we just skip caching
+ */
if (state->enable_fallback && font_cache_get (state->cache, wc, font, position))
return TRUE;
@@ -783,8 +784,9 @@ get_font (ItemizeState *state,
if (state->enable_fallback)
pango_fontset_foreach (state->current_fonts, get_font_foreach, &info);
- else
- get_font_foreach (NULL, get_base_font (state), &info);
+
+ if (!info.font)
+ info.font = get_base_font (state);
*font = info.font;
*position = info.position;
diff --git a/pango/meson.build b/pango/meson.build
index 2273f413..9f4c49be 100644
--- a/pango/meson.build
+++ b/pango/meson.build
@@ -46,6 +46,7 @@ pango_headers = [
'pango-font.h',
'pango-fontmap.h',
'pango-fontset.h',
+ 'pango-fontset-simple.h',
'pango-glyph.h',
'pango-glyph-item.h',
'pango-gravity.h',
diff --git a/pango/pango-trace-private.h b/pango/pango-trace-private.h
index 5d2a4fdf..8d5ebf51 100644
--- a/pango/pango-trace-private.h
+++ b/pango/pango-trace-private.h
@@ -42,9 +42,9 @@ void pango_trace_mark (gint64 begin_time,
#ifndef HAVE_SYSPROF
/* Optimise the whole call out */
#if defined(G_HAVE_ISO_VARARGS)
-#define g_trace_mark(b, n, m, ...)
+#define pango_trace_mark(b, n, m, ...) G_STMT_START { } G_STMT_END
#elif defined(G_HAVE_GNUC_VARARGS)
-#define g_trace_mark(b, n, m...)
+#define pango_trace_mark(b, n, m...) G_STMT_START { } G_STMT_END
#else
/* no varargs macro support; the call will have to be optimised out by the compiler */
#endif
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index d198df45..5b0c4999 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -835,7 +835,9 @@ match_in_thread (gpointer task_data)
ThreadData *td = task_data;
FcResult result;
FcPattern *match;
- gint64 before = PANGO_TRACE_CURRENT_TIME;
+ gint64 before G_GNUC_UNUSED;
+
+ before = PANGO_TRACE_CURRENT_TIME;
match = FcFontSetMatch (td->config,
&td->fonts, 1,
@@ -860,7 +862,9 @@ sort_in_thread (gpointer task_data)
ThreadData *td = task_data;
FcResult result;
FcFontSet *fontset;
- gint64 before = PANGO_TRACE_CURRENT_TIME;
+ gint64 before G_GNUC_UNUSED;
+
+ before = PANGO_TRACE_CURRENT_TIME;
fontset = FcFontSetSort (td->config,
&td->fonts, 1,
@@ -1023,9 +1027,11 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep
if (i == 0)
{
- gint64 before = PANGO_TRACE_CURRENT_TIME;
+ gint64 before G_GNUC_UNUSED;
gboolean waited = FALSE;
+ before = PANGO_TRACE_CURRENT_TIME;
+
g_mutex_lock (&pats->mutex);
while (!pats->match && !pats->fontset)
@@ -1050,9 +1056,11 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep
}
else
{
- gint64 before = PANGO_TRACE_CURRENT_TIME;
+ gint64 before G_GNUC_UNUSED;
gboolean waited = FALSE;
+ before = PANGO_TRACE_CURRENT_TIME;
+
g_mutex_lock (&pats->mutex);
while (!pats->fontset)
@@ -1354,7 +1362,9 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (PangoFcFontMap, pango_fc_font_map, PANGO_TYPE_
static gpointer
init_in_thread (gpointer task_data)
{
- gint64 before = PANGO_TRACE_CURRENT_TIME;
+ gint64 before G_GNUC_UNUSED;
+
+ before = PANGO_TRACE_CURRENT_TIME;
FcInit ();
@@ -1388,9 +1398,11 @@ start_init_in_thread (PangoFcFontMap *fcfontmap)
static void
wait_for_fc_init (void)
{
- gint64 before = PANGO_TRACE_CURRENT_TIME;
+ gint64 before G_GNUC_UNUSED;
gboolean waited = FALSE;
+ before = PANGO_TRACE_CURRENT_TIME;
+
g_mutex_lock (&fc_init_mutex);
while (fc_initialized < DEFAULT_CONFIG_INITIALIZED)
{
diff --git a/tests/meson.build b/tests/meson.build
index a4c545c3..b885f999 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -126,6 +126,19 @@ installed_test_layouts_data = [
'layouts/aaa.layout',
]
+installed_test_fonts_data = [
+ 'fonts/amiri-06dd.ttf',
+ 'fonts/Cantarell-VF.otf',
+ 'fonts/DejaVuSansMono.ttf',
+ 'fonts/DejaVuSans.ttf',
+ 'fonts/droid-sans-subset.ttf',
+ 'fonts/emoji-subset.ttf',
+ 'fonts/fa-regular-f2db.ttf',
+ 'fonts/fa-solid-f2db.ttf',
+ 'fonts/fonts.conf',
+ 'fonts/noto-sans-cjk.ttf',
+]
+
test_markups_data = [
'markups/fail-1',
'markups/fail-2',
@@ -231,6 +244,7 @@ installed_test_bindir = join_paths(pango_libexecdir, 'installed-tests', 'pango')
if get_option('install-tests')
install_data(installed_test_data, install_dir: installed_test_bindir)
+ install_data(installed_test_fonts_data, install_dir: join_paths(installed_test_bindir, 'fonts'))
install_data(installed_test_layouts_data, install_dir: join_paths(installed_test_bindir, 'layouts'))
install_data(installed_test_markups_data, install_dir: join_paths(installed_test_bindir, 'markups'))
install_data(installed_test_breaks_data, install_dir: join_paths(installed_test_bindir, 'breaks'))