diff options
author | Alexander Larsson <alexl@redhat.com> | 2012-12-05 13:56:06 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2012-12-06 16:36:19 +0100 |
commit | 3070717bc6e4c2a7bf83508ae5bf7a03eb77bf4b (patch) | |
tree | 271e308ecba228326aa3126f0719936f8d73904b /pango/pangocairo-context.c | |
parent | 3f3a095a1809375ef600dc3a947b3ff2df08f22c (diff) | |
download | pango-3070717bc6e4c2a7bf83508ae5bf7a03eb77bf4b.tar.gz |
Track changes in PangoContext via a serial
Whenever a PangoContext or its fontmap changes we bump the
contexts serial, you can get it via pango_context_get_serial()
to see find out if the context changed since the last time and
you need to relayout.
You can also force the context to be "changed" by calling
pango_context_changed().
https://bugzilla.gnome.org/show_bug.cgi?id=340066
Diffstat (limited to 'pango/pangocairo-context.c')
-rw-r--r-- | pango/pangocairo-context.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/pango/pangocairo-context.c b/pango/pangocairo-context.c index 65223b66..32b4ef1e 100644 --- a/pango/pangocairo-context.c +++ b/pango/pangocairo-context.c @@ -88,7 +88,7 @@ retry: return info; } -static gboolean +static void _pango_cairo_update_context (cairo_t *cr, PangoContext *context) { @@ -144,8 +144,8 @@ _pango_cairo_update_context (cairo_t *cr, pango_context_set_matrix (context, &pango_matrix); - - return changed; + if (changed) + pango_context_changed (context); } /** @@ -168,7 +168,7 @@ pango_cairo_update_context (cairo_t *cr, g_return_if_fail (cr != NULL); g_return_if_fail (PANGO_IS_CONTEXT (context)); - (void) _pango_cairo_update_context (cr, context); + _pango_cairo_update_context (cr, context); } /** @@ -237,7 +237,10 @@ pango_cairo_context_set_font_options (PangoContext *context, info = get_context_info (context, TRUE); - if (info->set_options) + if (info->set_options || options) + pango_context_changed (context); + + if (info->set_options) cairo_font_options_destroy (info->set_options); if (options) @@ -474,7 +477,6 @@ pango_cairo_update_layout (cairo_t *cr, g_return_if_fail (cr != NULL); g_return_if_fail (PANGO_IS_LAYOUT (layout)); - if (_pango_cairo_update_context (cr, pango_layout_get_context (layout))) - pango_layout_context_changed (layout); + _pango_cairo_update_context (cr, pango_layout_get_context (layout)); } |